# Await session.call\_tool(tool\_name, arguments=tool\_args) not working in the process query

**URL:** <https://community.deeplearning.ai/t/await-session-call-tool-tool-name-arguments-tool-args-not-working-in-the-process-query/842593>\
**Category:** MCP: Build Rich-Context AI Apps with Anthropic\
**Created:** [June 30, 2025, 10:55am UTC](https://community.deeplearning.ai/t/await-session-call-tool-tool-name-arguments-tool-args-not-working-in-the-process-query/842593 "2025-06-30T10:55:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkapmouo](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bkapmouo](https://community.deeplearning.ai/u/bkapmouo)\
**Post date:** [June 30, 2025, 10:55am UTC](https://community.deeplearning.ai/t/await-session-call-tool-tool-name-arguments-tool-args-not-working-in-the-process-query/842593/1 "2025-06-30T10:55:11Z")

</div>

Hi All,

I inspired myself from the MCP client code to build a streamlit chatbothat would connect to the following mcp servers.

- SQLITE
- BRAVE SEARCH
- FILE SYSTEM

Everything seems to work but whenever I write a prompt int he chatbot e.g how many tables do we have in our database I hangs and run forever. when I checked in the terminal I can see it calls the tools without parameters and when I debug I found out it is stuck at **result = await session.call\_tool(tool\_name, arguments=tool\_args)** , I haven’t been able to find the solution till now and would be grateful for any help. Attached is the app.py(where the streamlit application is implemented) and the mcp\_service.py where the (ChatbotClass is implemented) to test it you need to have a brave\_search api key and the sqlite DB is available in my repo under the data folder.

here is the my GitHub repo if want a global view :  
[mcp\_service.py](https://community.deeplearning.ai/uploads/short-url/r1W9IJFm9nPYIle8Q59isETXjrk.py) (4.7 KB)  
[app.py](https://community.deeplearning.ai/uploads/short-url/cSjuwCODDT8v0OuKYeWRwjjCWD2.py) (2.4 KB)

[https://github.com/Sulmon/mcp\_analyst\_app/tree/main](https://github.com/Sulmon/mcp_analyst_app/tree/main)

**here is how the app looks in the browser and it is stuck “Thinking..” for hours**

 ![image](https://global.discourse-cdn.com/dlai/original/3X/c/7/c740abb7d9492facdb7778267b38e67f9b8cae0e.png)

**And this is how it looks in the terminal (also stuck at calling tool ‘list\_tables with args:{}’)**

 ![image](https://global.discourse-cdn.com/dlai/original/3X/a/a/aa468d561dfdccb2c410496731d43bcb05a838e0.png)

**where I identified the problem to be (line code 103 , red dot)**

 ![image](https://global.discourse-cdn.com/dlai/original/3X/1/3/1311892c8e4ecc5eb8a1d77417225e0d6a25711f.png)
