validate_aprs_key
Check the validity of an APRS.fi API key to ensure secure access for ham radio tracking, balloon chase operations, and AI-driven APRS data analysis.
Instructions
Test if an APRS.fi API key is valid
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiKey | Yes | APRS.fi API key to validate |
Implementation Reference
- index.ts:231-257 (handler)Core handler function that validates the APRS.fi API key by making a test request to the APRS API and checking if the result is 'ok'.async validateApiKey(apiKey: string): Promise<boolean> { if (!apiKey) { return false; } try { const params = new URLSearchParams({ name: 'TEST', what: 'loc', apikey: apiKey, format: 'json' }); const response = await fetch(`${this.baseUrl}?${params}`); if (!response.ok) { return false; } const data: APRSResponse = await response.json(); return data.result === 'ok'; } catch { return false; } }
- index.ts:423-434 (handler)MCP tool call dispatcher that invokes the validateApiKey method and formats the response as MCP content.case 'validate_aprs_key': const isValid = await this.aprsService.validateApiKey( args.apiKey as string ); return { content: [ { type: 'text', text: JSON.stringify({ valid: isValid }, null, 2), }, ], };
- index.ts:350-363 (schema)Tool schema definition including input schema requiring 'apiKey' parameter.{ name: 'validate_aprs_key', description: 'Test if an APRS.fi API key is valid', inputSchema: { type: 'object', properties: { apiKey: { type: 'string', description: 'APRS.fi API key to validate', }, }, required: ['apiKey'], }, },
- index.ts:285-366 (registration)Registers the 'validate_aprs_key' tool in the MCP server's ListTools handler.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: 'get_aprs_position', description: 'Get current position data for a specific callsign from APRS.fi', inputSchema: { type: 'object', properties: { callsign: { type: 'string', description: 'The callsign to look up (e.g., "W1AW")', }, apiKey: { type: 'string', description: 'APRS.fi API key (optional if set via /set-api-key)', }, }, required: ['callsign'], }, }, { name: 'get_aprs_history', description: 'Get position history for a callsign with time range', inputSchema: { type: 'object', properties: { callsign: { type: 'string', description: 'The callsign to look up', }, apiKey: { type: 'string', description: 'APRS.fi API key (optional if set via /set-api-key)', }, lastHours: { type: 'number', description: 'Number of hours to look back (default: 24)', default: 24, }, }, required: ['callsign'], }, }, { name: 'track_multiple_callsigns', description: 'Track multiple callsigns at once', inputSchema: { type: 'object', properties: { callsigns: { type: 'array', items: { type: 'string', }, description: 'Array of callsigns to track', }, apiKey: { type: 'string', description: 'APRS.fi API key (optional if set via /set-api-key)', }, }, required: ['callsigns'], }, }, { name: 'validate_aprs_key', description: 'Test if an APRS.fi API key is valid', inputSchema: { type: 'object', properties: { apiKey: { type: 'string', description: 'APRS.fi API key to validate', }, }, required: ['apiKey'], }, }, ], }; });