Skip to main content
Glama

get_mcp_integration_metadata

Read-onlyIdempotent

Fetch self-reported metadata from an external MCP server integration, including name, version, protocol, capability flags, and sync status.

Instructions

Retrieve the external MCP server's self-reported metadata for an integration. Returns name, version, protocol, capability flags, and sync status; use get_mcp_integration for the Portkey-side connection config.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe MCP integration ID or slug

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool call succeeded and returned structured data
dataNoStructured success payload when ok is true
errorNoStructured error payload when ok is false

Implementation Reference

  • Tool handler for 'get_mcp_integration_metadata'. Calls service.mcpIntegrations.getMcpIntegrationMetadata(id) and formats the result with formatMcpIntegrationMetadata().
    server.tool(
    	"get_mcp_integration_metadata",
    	"Retrieve the external MCP server's self-reported metadata for an integration. Returns name, version, protocol, capability flags, and sync status; use get_mcp_integration for the Portkey-side connection config.",
    	MCP_INTEGRATIONS_TOOL_SCHEMAS.getMcpIntegrationMetadata,
    	async (params) => {
    		const metadata = await service.mcpIntegrations.getMcpIntegrationMetadata(
    			params.id,
    		);
    		return {
    			content: [
    				{
    					type: "text",
    					text: JSON.stringify(
    						formatMcpIntegrationMetadata(metadata),
    						null,
    						2,
    					),
    				},
    			],
    		};
    	},
  • Zod schema for getMcpIntegrationMetadata tool input: requires 'id' (string) describing the MCP integration ID or slug.
    getMcpIntegrationMetadata: {
    	id: z.string().describe("The MCP integration ID or slug"),
    },
  • Helper function formatMcpIntegrationMetadata that transforms raw McpIntegrationMetadata into a formatted response object with derived icon_count.
    function formatMcpIntegrationMetadata(metadata: McpIntegrationMetadata): {
    	server_name: string | null;
    	server_version: string | null;
    	title: string | null;
    	description: string | null;
    	website_url: string | null;
    	protocol_version: string | null;
    	icon_count: number;
    	capability_flags: unknown;
    	instructions: string | null;
    	sync_status: "pending" | "synced" | "error";
    	last_synced_at: string | null;
    	sync_error: string | null;
    } {
    	return {
    		server_name: metadata.server_name,
    		server_version: metadata.server_version,
    		title: metadata.title,
    		description: metadata.description,
    		website_url: metadata.website_url,
    		protocol_version: metadata.protocol_version,
    		icon_count: Array.isArray(metadata.icons) ? metadata.icons.length : 0,
    		capability_flags: metadata.capability_flags,
    		instructions: metadata.instructions,
    		sync_status: metadata.sync_status,
    		last_synced_at: metadata.last_synced_at,
    		sync_error: metadata.sync_error,
    	};
    }
  • Function registerMcpIntegrationsTools registers all MCP integration tools including 'get_mcp_integration_metadata' via server.tool().
    export function registerMcpIntegrationsTools(
    	server: McpServer,
    	service: PortkeyService,
    ): void {
    	server.tool(
    		"list_mcp_integrations",
    		"List MCP integrations in the organization. Returns paginated integration records plus total and has_more for discovering integration IDs; use get_mcp_integration for one integration's full Portkey-side config and list_mcp_servers for the servers under an integration.",
    		MCP_INTEGRATIONS_TOOL_SCHEMAS.listMcpIntegrations,
    		async (params) => {
    			const result = await service.mcpIntegrations.listMcpIntegrations(params);
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(
    							{
    								total: result.total,
    								has_more: result.has_more,
    								integrations: result.data.map(formatMcpIntegration),
    							},
    							null,
    							2,
    						),
    					},
    				],
    			};
    		},
    	);
    
    	server.tool(
    		"create_mcp_integration",
    		"Create an MCP integration from an external server URL. Registers the Portkey-side connection and returns the new id and slug; if auth_type is headers, custom_headers are required, and you usually follow with create_mcp_server and capability updates.",
    		MCP_INTEGRATIONS_TOOL_SCHEMAS.createMcpIntegration,
    		async (params) => {
    			if (
    				params.auth_type === "headers" &&
    				(!params.custom_headers ||
    					Object.keys(params.custom_headers).length === 0)
    			) {
    				return {
    					content: [
    						{
    							type: "text" as const,
    							text: "Error: custom_headers must be provided when auth_type is 'headers'",
    						},
    					],
    					isError: true,
    				};
    			}
    			const { custom_headers, ...rest } = params;
    			const result = await service.mcpIntegrations.createMcpIntegration({
    				...rest,
    				...(custom_headers ? { configurations: { custom_headers } } : {}),
    			});
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(
    							{
    								message: `Successfully created MCP integration "${params.name}"`,
    								id: result.id,
    								slug: result.slug,
    							},
    							null,
    							2,
    						),
    					},
    				],
    			};
    		},
    	);
    
    	server.tool(
    		"get_mcp_integration",
    		"Retrieve one MCP integration by id or slug. Returns the full Portkey-side config, including auth type, transport, and masked configuration keys; use get_mcp_integration_metadata for the server's self-reported metadata.",
    		MCP_INTEGRATIONS_TOOL_SCHEMAS.getMcpIntegration,
    		async (params) => {
    			const integration = await service.mcpIntegrations.getMcpIntegration(
    				params.id,
    			);
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(formatMcpIntegration(integration), null, 2),
    					},
    				],
    			};
    		},
    	);
    
    	server.tool(
    		"update_mcp_integration",
    		"Update an MCP integration's name, description, URL, auth, or transport. Changes apply immediately and altering url or auth_type can break connected clients; use update_mcp_server when you only need to rename or re-describe a server.",
    		MCP_INTEGRATIONS_TOOL_SCHEMAS.updateMcpIntegration,
    		async (params) => {
    			const { id, custom_headers, ...rest } = params;
    			await service.mcpIntegrations.updateMcpIntegration(id, {
    				...rest,
    				...(custom_headers ? { configurations: { custom_headers } } : {}),
    			});
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(
    							{
    								message: `Successfully updated MCP integration "${id}"`,
    								success: true,
    							},
    							null,
    							2,
    						),
    					},
    				],
    			};
    		},
    	);
    
    	server.tool(
    		"delete_mcp_integration",
    		"Delete an MCP integration and all servers beneath it. This is irreversible, removes connected access immediately, and should only be used after confirming nothing depends on the integration.",
    		MCP_INTEGRATIONS_TOOL_SCHEMAS.deleteMcpIntegration,
    		async (params) => {
    			await service.mcpIntegrations.deleteMcpIntegration(params.id);
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(
    							{
    								message: `Successfully deleted MCP integration "${params.id}"`,
    								success: true,
    							},
    							null,
    							2,
    						),
    					},
    				],
    			};
    		},
    	);
    
    	server.tool(
    		"get_mcp_integration_metadata",
    		"Retrieve the external MCP server's self-reported metadata for an integration. Returns name, version, protocol, capability flags, and sync status; use get_mcp_integration for the Portkey-side connection config.",
    		MCP_INTEGRATIONS_TOOL_SCHEMAS.getMcpIntegrationMetadata,
    		async (params) => {
    			const metadata = await service.mcpIntegrations.getMcpIntegrationMetadata(
    				params.id,
    			);
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(
    							formatMcpIntegrationMetadata(metadata),
    							null,
    							2,
    						),
    					},
    				],
    			};
    		},
    	);
    
    	server.tool(
    		"list_mcp_integration_capabilities",
    		"List capabilities exposed by the external MCP server for an integration. Returns total plus enabled-state entries so you can decide what to toggle; use before update_mcp_integration_capabilities when you need to compare the current surface.",
    		MCP_INTEGRATIONS_TOOL_SCHEMAS.listMcpIntegrationCapabilities,
    		async (params) => {
    			const result =
    				await service.mcpIntegrations.listMcpIntegrationCapabilities(params.id);
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(
    							{ total: result.total, capabilities: result.data },
    							null,
    							2,
    						),
    					},
    				],
    			};
    		},
    	);
    
    	server.tool(
    		"update_mcp_integration_capabilities",
    		"Bulk enable or disable capabilities on an MCP integration. Changes take effect immediately for connected users and hide or expose the selected tools, resources, and prompts; use list_mcp_integration_capabilities first if you need the current state.",
    		MCP_INTEGRATIONS_TOOL_SCHEMAS.updateMcpIntegrationCapabilities,
    		async (params) => {
    			await service.mcpIntegrations.updateMcpIntegrationCapabilities(
    				params.id,
    				{
    					capabilities: params.capabilities,
    				},
    			);
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(
    							{
    								message: `Successfully updated capabilities for MCP integration "${params.id}"`,
    								success: true,
    							},
    							null,
    							2,
    						),
    					},
    				],
    			};
    		},
    	);
    
    	server.tool(
    		"list_mcp_integration_workspaces",
    		"List which workspaces can access an MCP integration. Returns the global access mode plus per-workspace enablement for audit or permission review; use before update_mcp_integration_workspaces.",
    		MCP_INTEGRATIONS_TOOL_SCHEMAS.listMcpIntegrationWorkspaces,
    		async (params) => {
    			const result = await service.mcpIntegrations.listMcpIntegrationWorkspaces(
    				params.id,
    			);
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(
    							{
    								global_workspace_access: result.global_workspace_access,
    								workspace_count: result.workspaces.length,
    								workspaces: result.workspaces.map(
    									formatMcpIntegrationWorkspace,
    								),
    							},
    							null,
    							2,
    						),
    					},
    				],
    			};
    		},
    	);
    
    	server.tool(
    		"update_mcp_integration_workspaces",
    		"Grant or revoke workspace access to an MCP integration in bulk. Changes take effect immediately for all users in the selected workspaces; use list_mcp_integration_workspaces first to review the current access state.",
    		MCP_INTEGRATIONS_TOOL_SCHEMAS.updateMcpIntegrationWorkspaces,
    		async (params) => {
    			await service.mcpIntegrations.updateMcpIntegrationWorkspaces(params.id, {
    				workspaces: params.workspaces,
    			});
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(
    							{
    								message: `Successfully updated workspace access for MCP integration "${params.id}"`,
    								success: true,
    							},
    							null,
    							2,
    						),
    					},
    				],
    			};
    		},
    	);
    }
  • Service method getMcpIntegrationMetadata that makes a GET request to /mcp-integrations/{id}/metadata returning McpIntegrationMetadata.
    async getMcpIntegrationMetadata(id: string): Promise<McpIntegrationMetadata> {
    	return this.get<McpIntegrationMetadata>(
    		`/mcp-integrations/${this.encodePathSegment(id)}/metadata`,
    	);
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint=true and idempotentHint=true. The description adds value by specifying the exact data returned (name, version, protocol, capability flags, sync status) and highlighting that it's 'self-reported metadata', which goes beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two clear sentences with no wasted words. It front-loads the primary action and returns, then provides a concise usage alternative. Every sentence serves a purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the rich annotations (readOnly, idempotent, openWorld) and the existence of an output schema, the description covers the key aspects: what it does, what it returns, and when to use an alternative. It lacks mention of prerequisites or permissions, but openWorldHint suggests wide accessibility.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage for the single parameter 'id' with description 'The MCP integration ID or slug'. The description does not add any additional semantic meaning beyond what the schema already provides, so baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it retrieves 'external MCP server's self-reported metadata' and lists the specific fields returned (name, version, protocol, capability flags, sync status), distinguishing it from the sibling tool get_mcp_integration.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly tells when to use this tool vs. the alternative: 'use get_mcp_integration for the Portkey-side connection config.' This provides clear guidance for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/s-b-e-n-s-o-n/portkey-admin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server