Skip to content
Discussion options

You must be logged in to vote

@JonWoodlief I've added a comprehensive example and documentation for direct tool calling in this PR!

@jhaisley Thank you for the proposed solution, your example was really helpful in understanding what users need. I noticed some minor inconsistencies in the approach (due to an issue in our docs), so I created a complete example demonstrating the proper way to call MCP tools directly without an LLM.

Example:

"""
Direct tool calling example using MCPClient.

Notes:
- This demonstrates calling tools directly without an LLM/agent.
- This approach will not work for tools that require sampling.
"""

import asyncio

from mcp_use import MCPClient

config = {
    "mcpServers": {
        "everythi…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Pederzh
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants