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>
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the behavior of attempting to list namespaces and returning them on success, which indicates a read-only operation that may fail if the key is invalid. However, it does not detail error handling, rate limits, or authentication specifics, leaving gaps in behavioral context for a validation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences that are front-loaded with the purpose and efficiently cover validation method and outcome. Every sentence adds essential information with zero waste, making it appropriately sized and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is complete enough to understand its basic function. However, for a validation tool, it lacks details on error responses or failure modes, which could be important for agent handling. With no output schema, it should ideally explain return values more thoroughly, but it does state the return on success.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description adds value by explaining the validation mechanism and return behavior, which compensates for the lack of parameters, making it clear what the tool does without input. Baseline is 4 for 0 parameters as per rules.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('validates') and resource ('API key'), and distinguishes it from siblings by specifying the validation method ('by attempting to list namespaces') and outcome ('Returns the list of namespaces if successful'). This is precise and differentiates it from tools like 'listNamespaces' which would list namespaces without validation focus.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by stating it validates the API key, suggesting it should be used to check API key validity, likely before other operations. However, it does not explicitly state when not to use it or name alternatives (e.g., using 'listNamespaces' directly if validation is not needed), so it lacks explicit exclusions or named alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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