Skip to main content
Glama

validateApiKey

Verify API key validity by testing access to list namespaces on SourceSync.ai's knowledge management platform.

Instructions

Validates the API key by attempting to list namespaces. Returns the list of namespaces if successful.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'validateApiKey' tool. It creates a SourceSync client using environment variables and calls listNamespaces to validate the API key, wrapped in safeApiCall for error handling.
    async (params: ValidateApiKeyParams) => { return safeApiCall(async () => { // Create a client with the provided API key const client = createClient({}) // Validate the API key by listing namespaces // @ts-ignore - Ignoring type error for now to focus on error handling return await client.listNamespaces() }) },
  • Zod schema definition for the 'validateApiKey' tool input parameters. It is an empty object schema indicating no input parameters are required.
    export const validateApiKeySchema = z.object({})
  • src/index.ts:111-125 (registration)
    Registration of the 'validateApiKey' tool on the MCP server, including name, description, input schema, and handler function.
    server.tool( 'validateApiKey', 'Validates the API key by attempting to list namespaces. Returns the list of namespaces if successful.', validateApiKeySchema.shape, async (params: ValidateApiKeyParams) => { return safeApiCall(async () => { // Create a client with the provided API key const client = createClient({}) // Validate the API key by listing namespaces // @ts-ignore - Ignoring type error for now to focus on error handling return await client.listNamespaces() }) }, )
  • TypeScript type inferred from the validateApiKeySchema for use in the handler function.
    export type ValidateApiKeyParams = z.infer<typeof validateApiKeySchema>

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/pbteja1998/sourcesyncai-mcp'

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