Skip to content
Agent Factory
Library
Architecture3 min readReviewed Aug 2026

Tool Use & MCP Integrations

How agents call APIs, use MCP servers, and stay secure when acting on user data.

Tool design

Each tool should do exactly one thing with a clear input schema, predictable output, and idempotent behavior when possible. 'update_ticket' is a good tool. 'handle_ticket' (which might update, delete, or escalate depending on context) is a bad tool - the agent cannot reason about its effects.

Follow read-before-write patterns: give the agent a 'get_ticket' before 'update_ticket' so it always sees current state before making changes. Destructive tools (delete, send external email, charge payment) should require explicit confirmation or a separate approval step.

Write tool descriptions for the model, not for developers. 'Search the knowledge base for articles matching a query. Returns title, snippet, and URL for each match. Use this before answering product questions.' beats 'Calls /api/v2/kb/search with query param.' The model chooses tools based on descriptions - vague descriptions lead to wrong tool selection.

MCP in practice

Model Context Protocol (MCP) standardizes how agents connect to external systems - Slack, GitHub, databases, CRMs, and internal APIs. Instead of building custom integrations for every tool, MCP provides a universal connector format.

For agent products, MCP matters in two ways: as a consumer (your agent connects to MCP servers for Slack, Google Drive, etc.) and as a provider (you expose your agent's capabilities as an MCP server that other tools can call). Start by consuming - ship MCP connectors for the 2-3 integrations your ideal customer profile uses daily.

Do not try to support every MCP server on day one. Pick the integrations that appear in 80% of your design partner workflows. Deep, reliable connectors for HubSpot + Gmail + Slack beat shallow connectors for 20 tools.

4 more sections in this article

  • Security
  • Errors the model can act on
  • Idempotency and side effects
  • Versioning tools without breaking agents

This is Pro content

Get Agent Factory Pro - a one-time payment for lifetime access to full articles, complete build prompts, and everything new.

Use it

The parts of the library that put this article to work.

7 more build prompts reference this article.

Published 27 July 2026. Last reviewed 17 August 2026. We re-read this library on a schedule and date every article, so you can see for yourself how current it is.