Skip to main content
Glama
Garoth

WolframAlpha LLM MCP Server

by Garoth

validate_key

Verify the validity of a WolframAlpha LLM API key to ensure secure and authorized access for querying natural language questions.

Instructions

Validate the WolframAlpha LLM API key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'validate_key' tool handler function. It calls wolframLLMService.validateApiKey() and returns a text response indicating if the API key is valid or invalid.
    handler: async (_args: EmptyArgs): Promise<ToolResponse> => { const isValid = await wolframLLMService.validateApiKey(); return { content: [{ type: "text", text: isValid ? "API key is valid" : "API key is invalid" }] }; }
  • The core helper method in WolframLLMService class that validates the API key by making a test query to '2+2' and checking the response format.
    async validateApiKey(): Promise<boolean> { try { const params = new URLSearchParams({ appid: this.config.appId, input: '2+2' }); const response = await axios.get(`${this.baseUrl}?${params.toString()}`); return typeof response.data === 'string' && response.data.includes('Result:'); } catch (error) { if (axios.isAxiosError(error) && error.response?.data) { console.error('API Key Validation Error Response:', error.response.data); } return false; } }
  • src/index.ts:26-29 (registration)
    MCP server capabilities registration declaring the 'validate_key' tool as available.
    ask_llm: true, get_simple_answer: true, validate_key: true },
  • src/index.ts:80-82 (registration)
    Specific handling in the MCP CallToolRequestSchema handler for the 'validate_key' tool, invoking it with empty args.
    if (tool.name === 'validate_key') { response = await (tool as Tool<EmptyArgs>).handler({}); } else {
  • Input schema for the 'validate_key' tool, which requires no arguments.
    inputSchema: { type: "object", properties: {}, required: [] },

Other Tools

Related 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/Garoth/wolframalpha-llm-mcp'

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