Skip to main content
Glama

get_ref_data

Retrieve system reference data and lookup information for categories like user management, content operations, and site administration on the Kapiti platform.

Instructions

Get system reference data and lookups

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoReference data category to filter by

Implementation Reference

  • src/index.ts:239-270 (registration)
    Registration of the 'get_ref_data' MCP tool, including title, description, empty input schema, and inline async handler function that fetches and returns system reference data from the Headlesshost API endpoint `/tools/system/refdata`, handling errors with handleApiError.
    server.registerTool( "get_ref_data", { title: "Get Reference Data", description: "Get system reference data and lookups for global use. For sections types call the get_staging_site_configuration endpoint.", inputSchema: {}, }, async () => { try { const response: AxiosResponse<ApiResponse> = await apiClient.get(`/tools/system/refdata`); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: handleApiError(error), }, ], isError: true, }; } } );
  • Inline handler function for the get_ref_data tool: performs a GET request to `/tools/system/refdata`, stringifies and returns the API response as text content, or error content on failure.
    async () => { try { const response: AxiosResponse<ApiResponse> = await apiClient.get(`/tools/system/refdata`); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: handleApiError(error), }, ], isError: true, }; } }
  • Tool metadata including title, description, and empty inputSchema (no parameters required).
    { title: "Get Reference Data", description: "Get system reference data and lookups for global use. For sections types call the get_staging_site_configuration endpoint.", inputSchema: {},
  • TypeScript interface defining the structure of reference data, likely matching the API response format (category with key-value items).
    interface RefData { category: string; items: Array<{ key: string; value: string; metadata?: any; }>; }
  • Helper function used by the handler to format API errors into user-friendly messages.
    function handleApiError(error: any): string { if (error.response) { return `API Error ${error.response.status}: ${error.response.data?.message || error.response.statusText}`; } else if (error.request) { return "Network Error: Unable to reach API server"; } else { return `Error: ${error.message}`; } }

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/Headlesshost/mcp-server'

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