validateApiKey
Verify API key validity for SourceSync.ai by testing access to list namespaces, ensuring proper authentication for knowledge management operations.
Instructions
Validates the API key by attempting to list namespaces. Returns the list of namespaces if successful.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:115-124 (handler)The inline handler function that executes the validateApiKey tool logic. 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() }) },
- 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() }) }, )
- src/schemas.ts:110-110 (schema)Zod schema for validateApiKey tool input parameters, defined as an empty object since no parameters are required.export const validateApiKeySchema = z.object({})