https://linen.dev logo
Composio MCP tools not being exposed to the agent ...
# 🖥│support-forum
a
After updating the Composio MCP configuration according to the official Composio documentation, I changed the session configuration from the default MCP setup to the Direct Tools approach, enabling the required Tavily tool (TAVILY_SEARCH). However, although the Tavily toolkit/tool is connected and configured in the Composio dashboard, the agent is still unable to properly fetch and use the corresponding connected Composio tool. Previously, with the default MCP session configuration, the MCP client was returning Composio meta-tools such as COMPOSIO_SEARCH_TOOLS instead of the actual Tavily search tool. Following the newer architecture, I configured the session using SESSION_PRESET_DIRECT_TOOLS and explicitly enabled TAVILY_SEARCH The question is: According to the current Composio MCP architecture and official documentation, why is the connected Tavily tool still not being exposed/available for the LLM to directly invoke, even though the Tavily toolkit is connected and TAVILY_SEARCH has been explicitly enabled in the Composio session? Here is my notebook link: https://colab.research.google.com/drive/18jhC1kKmdpLn9sbBiEoZrbMak2r-1mxk?usp=sharing
b
Hi,
TAVILY_SEARCH
is being exposed correctly. In your notebook output, the model calls
TAVILY_SEARCH
directly, and the call then fails with
No active connection found for toolkit(s) 'tavily' in this session.
This is a connection-scope issue, not a direct-tools issue. The session is created with
user_id="Surebrec"
. A Tavily connection is available to that session only when it belongs to the same project and user ID, or when an eligible account is explicitly selected. Authorize Tavily for this session user before running the agent:
Copy code
connection_request = session.authorize("tavily")
print(connection_request.redirect_url)
connection_request.wait_for_connection()
After completing the link, reconnect the MCP client or create a fresh session with the same user ID, then rerun the agent. If you want to reuse an existing dashboard connection instead, create the session with the
user_id
that owns that connection and select its ID through
connected_accounts
. You do not need to change
SESSION_PRESET_DIRECT_TOOLS
or the
TAVILY_SEARCH
selection.
a
Okay, thanks, Soham. I fixed the issue by adding your code cell, and the connection request is working now. Please check the notebook here: https://colab.research.google.com/drive/18jhC1kKmdpLn9sbBiEoZrbMak2r-1mxk?usp=sharing It asks for an API key every time I run Cell 6. After configuring the Tavily API key, I’m able to authorize the Tavily connection through the Composio MCP integration in the agent. Even though the response says that it cannot run external actions through my personal Composio integrations after authorization, the overall flow is working correctly. The agent is able to choose the appropriate tools based on the user’s question, and it has successfully used the
TAVILY_SEARCH
tool. Also, one more thing! I have changed the code slightly to check if the composio account is already connected then we don't need to configure the api key for authorization again. for that i made modifications in the code cell - 6 using GPT.
b
Hi, Thanks for confirming the flow is working.
TAVILY_SEARCH
is now available directly to the agent and the successful invocation confirms the session has an eligible Tavily connected account. You should not need to enter the Tavily API key on every run when the existing connected account is reused. Keep the same project and stable
user_id
, and reuse the existing session or create an unpinned session for that same user. Only start a new authorization request when no eligible Tavily account exists, or when you intentionally need to replace it. The agent message about not being able to run external actions does not reflect the actual tool availability in this case: a successful
TAVILY_SEARCH
call is an external tool execution through the authorized account.