Extended Metadata

The mcpgate_tool_metadata tool is a built-in MCPGate tool that returns rich structured metadata for every tool exposed by the server. Call it once after connecting to build a local registry your client can use for UI rendering, risk scoring, and activity feed formatting.

MCPGate extension

This tool is not part of the MCP specification. It is an MCPGate-specific extension. The tool will appear in tools/list alongside connector tools and is called the same way as any other MCP tool.

Calling the tool#

mcpgate_tool_metadata takes no required parameters. An optional tools array lets you request metadata for a specific subset of tools by name. Omit it to get metadata for all tools.

tools/call request
json
{
  "name": "mcpgate_tool_metadata",
  "arguments": {}
}

Or filter to specific tools:

tools/call request (filtered)
json
{
  "name": "mcpgate_tool_metadata",
  "arguments": {
    "tools": ["gmail_send_email", "gmail_delete_email"]
  }
}

Response schema#

The tool returns a JSON object with a tools array. Each entry describes one tool:

FieldTypeDescription
toolstringMCP tool name (matches the name in tools/list)
connectorIdstringConnector identifier (e.g. gmail, slack)
titlestringShort human-readable label for the tool (same as annotation title)
riskLevelnumberNumeric risk score: 1 (read), 2 (write), 3 (delete)
categorystringAction category: read, write, or delete
actionTemplatestringSentence template for activity feeds. Use {param} placeholders

Full example response#

mcpgate_tool_metadata response
json
{
  "tools": [
    {
      "tool": "gmail_read_email",
      "connectorId": "gmail",
      "title": "Read Email",
      "riskLevel": 1,
      "category": "read",
      "actionTemplate": "Read email {messageId}"
    },
    {
      "tool": "gmail_send_email",
      "connectorId": "gmail",
      "title": "Send Email",
      "riskLevel": 2,
      "category": "write",
      "actionTemplate": "Sent email to {to} with subject \"{subject}\""
    },
    {
      "tool": "gmail_delete_email",
      "connectorId": "gmail",
      "title": "Delete Email",
      "riskLevel": 3,
      "category": "delete",
      "actionTemplate": "Deleted email {messageId}"
    },
    {
      "tool": "slack_post_message",
      "connectorId": "slack",
      "title": "Post Message",
      "riskLevel": 2,
      "category": "write",
      "actionTemplate": "Posted message to {channel}"
    },
    {
      "tool": "github_delete_branch",
      "connectorId": "github",
      "title": "Delete Branch",
      "riskLevel": 3,
      "category": "delete",
      "actionTemplate": "Deleted branch {branch} from {owner}/{repo}"
    }
  ]
}

Using actionTemplate#

The actionTemplate field is a sentence with {param} placeholders that match parameter names in the tool's input schema. Substitute actual argument values at call time to generate a human-readable activity entry.

activity-feed.ts
typescript
function formatActivity(template: string, args: Record<string, unknown>): string {
  return template.replace(/\{(\w+)\}/g, (_, key) =>
    args[key] !== undefined ? String(args[key]) : `{${key}}`
  )
}

// Example:
const template = 'Sent email to {to} with subject "{subject}"'
const args = { to: '[email protected]', subject: 'Meeting notes' }
const label = formatActivity(template, args)
// → 'Sent email to [email protected] with subject "Meeting notes"'

Using riskLevel for UI#

The numeric riskLevel maps directly to a traffic-light colour scheme most users find intuitive:

  • 1 — read: green / no confirmation needed
  • 2 — write: yellow / show a brief notice
  • 3 — delete: red / require explicit confirmation

This complements the binary destructive annotation with a finer-grained signal you can use to style tool badges, sort tool lists by risk, or gate auto-approval policies.