MCP Schema Documentation

How MCPify transforms your API into rich, self-documenting MCP tools

The Model Context Protocol (MCP) uses JSON Schema to describe tools, their inputs, outputs, and capabilities. MCPify automatically generates comprehensive MCP schemas from your existing API specifications, enriching them with metadata that helps AI agents make intelligent decisions.

Schema Components

Tool Definition

Each API endpoint becomes an MCP tool with a unique name, description, and schema:

{
  "name": "crm___listContacts",
  "title": "List CRM Contacts",
  "description": "GET /api/v1/contacts - Retrieve a paginated list of contacts with optional filtering by status, tags, and creation date. Returns contact objects with full profile information.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "page": {
        "type": "integer",
        "minimum": 1,
        "default": 1,
        "description": "Page number for pagination"
      },
      "page_size": {
        "type": "integer",
        "minimum": 1,
        "maximum": 100,
        "default": 20,
        "description": "Number of items per page"
      },
      "status": {
        "type": "string",
        "enum": ["active", "inactive", "pending"],
        "description": "Filter by contact status"
      },
      "created_after": {
        "type": "string",
        "format": "date-time",
        "description": "Filter contacts created after this date"
      }
    }
  }
}

Output Schema

A tool can declare an output schema, so agents know what the result looks like. When it does, the gateway also returns the matching fields as structuredContent:

{
  "outputSchema": {
    "type": "object",
    "properties": {
      "data": {
        "type": "array",
        "items": { "type": "object" },
        "description": "Array of contact objects"
      },
      "pagination": {
        "type": "object",
        "properties": {
          "page": { "type": "integer" },
          "page_size": { "type": "integer" },
          "total_pages": { "type": "integer" },
          "total_items": { "type": "integer" },
          "has_next": { "type": "boolean" },
          "has_previous": { "type": "boolean" }
        }
      }
    }
  }
}

Rich Metadata

Each tool's entry in the service config carries what an agent needs to plan a call:

"listContacts": {
  "title": "List contacts",
  "description": "List contacts, optionally filtered by status. Paginated; 20 per page by default.",
  "endpoint": "/api/v1/contacts",
  "method": "GET",
  "cacheTTL": 300,
  "inputSchema": {
    "type": "object",
    "properties": {
      "status": { "type": "string", "enum": ["active", "archived"] },
      "page": { "type": "integer", "default": 1 }
    }
  }
}

Schema Generation Process

1

Import API Specification

MCPify reads your OpenAPI specification or GraphQL schema; SOAP services come in through their WSDL converted to OpenAPI

2

Analyze Endpoints

Each endpoint is analyzed for parameters and request/response shapes

3

Generate Tool Definitions

Endpoints are converted to MCP tools with descriptive names and comprehensive documentation

4

Enrich with Metadata

Caching rules are set, and examples are taken from the API spec

5

Validate & Optimize

Schemas are validated and optimized for token efficiency

6

Publish to Gateway

Final schemas are deployed to the MCPify gateway for agent access

Advanced Schema Features

Pagination Strategies

Automatic detection and documentation of pagination patterns

  • Cursor-based pagination
  • Offset/limit pagination
  • Page number pagination

Type Inference

Smart type detection from responses and documentation

  • Nullable field detection
  • Format validation (email, URL, UUID)
  • Enum extraction

Examples from the Spec

Examples taken from your API spec for each tool

  • Parameter examples
  • Request body examples
  • Response examples

Customizing Generated Schemas

While MCPify generates comprehensive schemas automatically, each tool is an entry in your service's configuration, so its title, description, input schema and cache TTL can be adjusted to match your specific needs:

{
  "serviceName": "crm",
  "baseUrl": "https://api.your-crm.com/v1",
  "tools": {
    "listContacts": {
      "title": "List contacts",
      "description": "Custom description for the list contacts tool",
      "endpoint": "/contacts",
      "method": "GET",
      "cacheTTL": 300,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": { "type": "integer", "description": "Maximum contacts to return" }
        }
      }
    }
  }
}

Schema Best Practices

✅ Do's

  • • Provide detailed descriptions for all parameters
  • • Include realistic examples for complex operations
  • • Document all possible error responses
  • • Specify clear constraints (min/max, required fields)
  • • Use consistent naming conventions

❌ Don'ts

  • • Don't use ambiguous parameter names
  • • Don't omit error documentation
  • • Don't forget pagination limits
  • • Don't ignore deprecated fields
  • • Don't use inconsistent date formats
  • • Don't skip validation rules

Related Documentation