Variables let you pass parameters when connecting to a catalog. This enables multi-tenant scenarios where the same catalog serves different customers with different configuration.
A variable is a named parameter that:
Your API requires a tenant identifier:
https://api.example.com/tenants/{tenant_id}/customersDefine a tenant_id variable. Each customer provides their own tenant ID when connecting.
Different customers use different servers:
Variable: api_base_urlCustomer A: https://customer-a.example.comCustomer B: https://customer-b.example.comYour API requires a customer-specific header:
Header: X-Customer-IDVariable: customer_id| Property | Description |
|---|---|
| Name | The variable identifier (e.g., tenant_id) |
| Description | Help text for users |
| Required | Whether the variable must be provided |
| Default | Default value if not provided |
Variables are passed via the MCP connection URL:
https://mcp.toolcog.com/mycompany/saas-api?tenant_id=acmeOr in the MCP configuration:
{ "mcpServers": { "my-api": { "url": "https://mcp.toolcog.com/mycompany/saas-api", "variables": { "tenant_id": "acme" } } }}When AI executes an operation, variables are resolved:
# Catalog variable mapping:path: /tenants/{tenant_id}/customersmaps_to: $tenant_id # Uses the tenant_id variable# Catalog variable mapping:header: X-Tenant-IDvalue: $tenant_id# Catalog variable mapping:query: tenantvalue: $tenant_id# Catalog variable mapping:server: https://{customer_subdomain}.api.example.comcustomer_subdomain: $customer_subdomainVariables can be scoped at different levels:
Apply to all operations:
scope: "*"variable: tenant_idmaps_to: path.tenant_idApply to operations from a specific API:
scope: "myapi/*"variable: api_versionmaps_to: header.X-API-VersionApply to specific operations:
scope: "myapi/users.create"variable: regionmaps_to: query.regionA SaaS provider wants customers to use their API via Toolcog:
tenant_id, api_keyCustomer A: https://mcp.toolcog.com/saas/api?tenant_id=a&api_key=key_aCustomer B: https://mcp.toolcog.com/saas/api?tenant_id=b&api_key=key_bAn API has different endpoints per region:
regionhttps://{region}.api.example.comUS: https://mcp.toolcog.com/mycompany/api?region=usEU: https://mcp.toolcog.com/mycompany/api?region=euYou want to provide API access to your customers’ customers:
customer_idX-Customer-IDToolcog validates variables when connecting:
Variables appear in URLs and logs. For sensitive values: