Skip to content

Last update 

Adoption · Build

Tool design principles

Design task-oriented MCP tools with small counts, clear descriptions, server guardrails, and structured JSON.

Build each tool around one user task, not one backend endpoint.

Experience-oriented versus system APIs

Do not auto-generate tools from every REST or OpenAPI endpoint. Traditional APIs expose granular endpoints for caller flexibility. MCP tools should complete one user task. Large tool sets lower selection accuracy, so combine multi-step workflows into one tool.

System API approach Experience-oriented approach
create_ticket, add_comment, assign_ticket, notify_user file_support_request. Runs all 4 steps internally.
list_deployments, get_deployment, get_logs summarize_recent_deployments. Aggregates and summarizes deployments.
search_orders, get_order_details, get_customer_info lookup_order. Combines all 3 calls with full context.

Each tool call spends tokens and adds a decision. Composite tools cut steps and improve reliability.

Key design guidelines

1. Limit tool count

Keep each MCP server on one domain, at 15 or fewer tools as a rule of thumb. Split or consolidate larger sets:

  • Split domains across MCP servers, such as Sales, Finance, and IT.
  • Group related operations into composite tools.
  • Replace variant tools with a single tool and a status enum parameter.
2. Use task-focused names

Name tools for user goals, not backend operations:

  • Replace execute_sql_query with analyze_sales_trends.
  • Replace get_tickets_by_status with find_open_support_issues.
  • Replace update_record with change_customer_address.
3. Return decision-ready data

Return structured summaries instead of raw data dumps. For example, return this summary instead of 100 rows of deployment logs:

{
  "summary": "3 deployments in last 24h: 2 successful, 1 failed",
  "failed_deployment": {
    "name": "api-v2.1.3",
    "error": "Health check timeout",
    "recommendation": "Check database connection pool settings"
  },
  "recent_deployments": [
    {
      "name": "api-v2.1.3",
      "status": "failed"
    },
    {
      "name": "api-v2.1.2",
      "status": "succeeded"
    }
  ]
}
4. Embed guardrails server-side

Do not rely on language models to enforce business rules. Validate and constrain every operation inside your MCP server code:

  • Reject refunds above the order total.
  • Block account deletion when the balance exceeds 0.
  • Require manager approval for expenses over $5000.
  • Enforce data residency rules based on tenant identity.
5. Write clear descriptions

Write 2 to 3 sentences so models know when and how to call the tool. Start with an action verb, state automatic side effects, and say when to use the tool:

{
  "name": "file_support_request",
  "description": "Creates a new support ticket with customer details, issue description, and priority. Automatically assigns the ticket to the right team based on category. Use when a customer reports a problem or needs help.",
  "inputSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "customer_email": {
        "type": "string",
        "format": "email",
        "maxLength": 254
      },
      "issue_type": {
        "type": "string",
        "enum": ["billing", "technical", "account"]
      },
      "description": {
        "type": "string",
        "maxLength": 2000
      }
    },
    "required": ["customer_email", "issue_type", "description"]
  }
}

Common anti-patterns

Exposing raw database queries

An execute_sql(query: string) tool risks SQL injection and data exposure. It relies on model-written SQL and prevents reliable access control.

Expose purpose-specific tools such as get_customer_orders or search_products instead.

Too many similar tools

Separate tools (get_active_orders, get_pending_orders, get_completed_orders, get_cancelled_orders) inflate tool count and lower selection accuracy.

Use one get_orders tool with a status enum parameter instead.

Returning unstructured text

HTML, Markdown, or long prose forces the model to parse text and raises extraction errors.

Return JSON with explicit fields that the agent can reference directly.

No rate limits or quotas

Without rate limits, a runaway agent loop can exhaust backends.

Enforce per-caller server limits and return HTTP 429 with Retry-After (MCP-03). Add gateway limits with API Management Expose existing MCP server Checked · Source page It supports tools and resources, not prompts, and lacks workspace support. Backends need MCP 2025-06-18 or later, and policies must not read context.Response.Body at MCP scope. or AI Gateway Per-server tool allowlists and blocklists Checked · Source page It enforces per-server allowlists, blocklists where block wins, accessState, and request rate limits before backend calls..

API Management policy scope

API Management applies MCP policies per server, not per tool. Use AI Gateway Per-server tool allowlists and blocklists Checked · Source page It enforces per-server allowlists, blocklists where block wins, accessState, and request rate limits before backend calls. to allow or block individual tools.

Tool design checklist

Verify before schema design:

  • Keep each MCP server at 15 or fewer task-oriented tools.
  • Name tools for user tasks, not database or CRUD calls.
  • Enforce rules and authorization in server code, never prompt text alone (MCP-04).
  • Write 2 to 3 sentence descriptions with action, automatic side effects, and trigger.
  • Enforce per-caller rate limits in the MCP server (MCP-03), with gateway limits as a second layer.

OWASP MCP Top 10, 2025 edition risks: MCP02 Privilege Escalation via Scope Creep, MCP03 Tool Poisoning, MCP05 Command Injection and Execution