Skip to main content
Glama

get-backend-metadata

Retrieve structured metadata from the Insforge backend platform to access Auth, Database, Storage, and Functions configuration details for development workflows.

Instructions

Index all backend metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiKeyNoAPI key for authentication (optional if provided via --api_key)

Implementation Reference

  • The core handler function for the 'get-backend-metadata' tool. It fetches metadata from the backend API endpoint `/api/metadata?mcp=true` using the resolved API key, processes the response, adds optional background context, and returns a formatted text content block or error response.
    withUsageTracking('get-backend-metadata', async ({ apiKey }) => { try { const actualApiKey = getApiKey(apiKey); const response = await fetch(`${API_BASE_URL}/api/metadata?mcp=true`, { method: 'GET', headers: { 'x-api-key': actualApiKey, }, }); const metadata = await handleApiResponse(response); return await addBackgroundContext({ content: [ { type: 'text', text: `Backend metadata:\n\n${JSON.stringify(metadata, null, 2)}`, }, ], }); } catch (error) { const errMsg = error instanceof Error ? error.message : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error retrieving backend metadata: ${errMsg}`, }, ], isError: true, }; } })
  • The MCP server.tool registration for 'get-backend-metadata', including tool name, description, input schema, and wrapped handler reference.
    server.tool( 'get-backend-metadata', 'Index all backend metadata', { apiKey: z .string() .optional() .describe('API key for authentication (optional if provided via --api_key)'), }, withUsageTracking('get-backend-metadata', async ({ apiKey }) => { try { const actualApiKey = getApiKey(apiKey); const response = await fetch(`${API_BASE_URL}/api/metadata?mcp=true`, { method: 'GET', headers: { 'x-api-key': actualApiKey, }, }); const metadata = await handleApiResponse(response); return await addBackgroundContext({ content: [ { type: 'text', text: `Backend metadata:\n\n${JSON.stringify(metadata, null, 2)}`, }, ], }); } catch (error) { const errMsg = error instanceof Error ? error.message : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error retrieving backend metadata: ${errMsg}`, }, ], isError: true, }; } }) );
  • Zod input schema for the tool, defining an optional 'apiKey' parameter.
    { apiKey: z .string() .optional() .describe('API key for authentication (optional if provided via --api_key)'), },
  • Helper function used by the handler to resolve the API key from global config, ignoring tool-specific param for consistency.
    // The optional parameter is kept for backward compatibility but ignored const getApiKey = (_toolApiKey?: string): string => { if (!GLOBAL_API_KEY) { throw new Error('API key is required. Pass --api_key when starting the MCP server.'); } return GLOBAL_API_KEY; };

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/InsForge/insforge-mcp'

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