How do you connect your tools to an agent through MCP?
11 posts
Playbook
Practitioners prioritize precise tool descriptions, error handling for model recovery, and testing individual connectors to ensure reliable agentic workflows.
- Optimize tool definitions
Merge near-duplicate tools to reduce wrong-tool errors and token counts , and favor two narrow tools over one large tool using an action enum . 110
- Enhance tool descriptions
Write descriptions stating the format, when to use a tool, what it returns, and what to do next [5, 10]; use a schema tool to look up column names and reduce guesses . 4510
- Improve error handling
Return errors as normal results using isError to help the model correct itself [3, 10], and provide recovery guidance within error messages . 3510
- Manage identifiers and writes
Search for required character-by-character IDs instead of letting the model generate them, and use dry runs for writes and deletes . 2
- Verify connectivity and usage
Test each connector alone before registration and use run receipts to confirm a routine actually queries the source . 9
- Implement sandboxed orchestration
Use a QuickJS WASM sandbox on the harness side to compose tool calls without passing through the LLM context . 6
Choosing between approaches
While switching the tool list allows for new capabilities, it invalidates the cache and can rewrite 40 to 57K tokens 2. In Mintlify Admin MCP, setting ask rules for write actions provides security but requires manual confirmation, whereas reads and comments run freely 8.
Not covered yet
The material does not cover specific security protocols for handling sensitive data within the MCP tool calls themselves beyond gateway-level enforcement 7.
Posts
- Log MCP calls for 16 days: three tools did 91%, so merge near-duplicate toolsThe author logged calls to their own MCP server for 16 days: 427 runs and 1,318 calls, with three tools making up 91%.

- Do not let the model generate IDs; search first, dry-run writes, and watch the cacheAfter building 100+ tools for one MCP server, the author lists lessons: IDs that must be correct character by character should not be generated by the model but searched for and passed on; writes and deletes get a dry run, with a check that required fields can really be filled; and each tool is labeled by whether it was tested.

- Return MCP errors as normal results with isError and refuse vague requestsThe author maintains an MCP server called from Claude Code, Cursor and Gemini.

- Give an MCP server a schema tool and error messages that name the parameter to useBuilding a spreadsheet MCP server in Python, the author notes the model only sees tool names, descriptions, parameter notes and error messages.

- Write MCP tool descriptions for the agent: state formats, name alternatives, keep output shortThe author built an MCP server for looking up a service directory: two hours of code, fourteen hours making it comfortable for an agent.

- Compose tool calls in a QuickJS sandbox without passing through the LLM contextArmin Ronacher introduces Codemode in Pi 1.0 to solve the problem that Bash cannot compose non-program tools such as image reading and subagents.

- Add a dataset with one JSON metadata file behind a serverless MCP gatewayAn AWS team built a serverless MCP server on Amazon ECS Fargate to funnel agent access to a data lake through one gateway.

- Set ask rules on Mintlify Admin MCP write actions while keeping edits and reads freeThis Claude Code settings template sets ask rules for the Mintlify Admin MCP's publish, merge, delete, move-node, config-update and project-management write actions, while page edits, comments and reads run freely.

- Test each connector alone and read run receipts to confirm a routine really uses itJenny Ouyang covers connecting Claude routines to outside sources such as Gmail and Apify.

- Describe each MCP tool by when to use it, what it returns and what to do nextThe author built two tools, search_notes and get_note, for scattered internal docs.

1 more post to see