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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:115-124 (handler)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() }) },
- src/schemas.ts:110-110 (schema)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() }) }, )
- src/schemas.ts:165-165 (schema)TypeScript type inferred from the validateApiKeySchema for use in the handler function.export type ValidateApiKeyParams = z.infer<typeof validateApiKeySchema>