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
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.
{
"name": "mcpgate_tool_metadata",
"arguments": {}
}Or filter to specific tools:
{
"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:
| Field | Type | Description |
|---|---|---|
tool | string | MCP tool name (matches the name in tools/list) |
connectorId | string | Connector identifier (e.g. gmail, slack) |
title | string | Short human-readable label for the tool (same as annotation title) |
riskLevel | number | Numeric risk score: 1 (read), 2 (write), 3 (delete) |
category | string | Action category: read, write, or delete |
actionTemplate | string | Sentence template for activity feeds. Use {param} placeholders |
Full example response#
{
"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.
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.