Skip to main content
Glama
dhhuston

APRS.fi MCP Server

by dhhuston

get_aprs_history

Retrieve historical position data for ham radio callsigns within specified timeframes to track movement patterns and analyze location history.

Instructions

Get position history for a callsign with time range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
callsignYesThe callsign to look up
apiKeyNoAPRS.fi API key (optional if set via /set-api-key)
lastHoursNoNumber of hours to look back (default: 24)

Implementation Reference

  • Core handler function that implements the get_aprs_history tool by querying the APRS.fi API for historical position data of a callsign over the last N hours.
    async getPositionHistory(
      callsign: string, 
      apiKey?: string,
      lastHours: number = 24
    ): Promise<APRSPosition[]> {
      const keyToUse = apiKey || this.apiKey;
      if (!keyToUse) {
        throw new APRSError('APRS API key not provided. Use /set-api-key command or provide apiKey parameter.');
      }
    
      if (!callsign?.trim()) {
        throw new APRSError('Callsign is required');
      }
    
      const params = new URLSearchParams({
        name: callsign.trim().toUpperCase(),
        what: 'loc',
        apikey: keyToUse,
        format: 'json',
        last: lastHours.toString()
      });
    
      try {
        const response = await fetch(`${this.baseUrl}?${params}`);
        
        if (!response.ok) {
          throw new APRSError(
            `APRS API request failed: ${response.status} ${response.statusText}`,
            response.status
          );
        }
    
        const data: APRSResponse = await response.json();
    
        if (data.result !== 'ok') {
          throw new APRSError(`APRS API error: ${data.result}`);
        }
    
        return data.entries.map(entry => ({
          ...entry,
          timestamp: entry.timestamp * 1000,
        })).sort((a, b) => a.timestamp - b.timestamp);
    
      } catch (error) {
        if (error instanceof APRSError) {
          throw error;
        }
        
        if (error instanceof TypeError && error.message.includes('fetch')) {
          throw new APRSError('Network error: Unable to connect to APRS.fi API. Check your internet connection.');
        }
        
        throw new APRSError(`Unexpected error: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • MCP CallToolRequestSchema handler case for get_aprs_history that invokes the service method and returns the result as JSON text content.
    case 'get_aprs_history':
      const history = await this.aprsService.getPositionHistory(
        args.callsign as string,
        args.apiKey as string,
        args.lastHours as number
      );
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(history, null, 2),
          },
        ],
      };
  • index.ts:306-328 (registration)
    Tool registration in ListToolsRequestSchema response, defining the name, description, and input schema for get_aprs_history.
    {
      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'],
      },
    },
  • Type definition for the API response structure used in get_aprs_history.
    interface APRSResponse {
      command: string;
      result: string;
      what: string;
      found: number;
      entries: APRSPosition[];
    }
  • Type definition for individual APRS position data returned by the get_aprs_history tool.
    interface APRSPosition {
      name: string;
      callsign: string;
      lat: number;
      lng: number;
      altitude?: number;
      timestamp: number;
      comment?: string;
      speed?: number;
      course?: number;
      symbol?: string;
      path?: string;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool does, not how it behaves. It doesn't mention authentication requirements (though the apiKey parameter hints at this), rate limits, error conditions, response format, or whether this is a read-only operation versus something that might modify data.

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 a single, efficient sentence that states the core functionality without any unnecessary words. It's appropriately sized and front-loaded with the essential information.

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

Completeness2/5

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

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns (position history format), authentication requirements, error handling, or how it differs from sibling tools. The agent would need to guess about important behavioral aspects.

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

Parameters3/5

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

With 100% schema description coverage, the input schema already documents all three parameters thoroughly. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline but doesn't provide extra value.

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

Purpose4/5

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

The description clearly states the action ('Get position history') and resource ('for a callsign with time range'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'get_aprs_position' which presumably retrieves current rather than historical position data.

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

Usage Guidelines2/5

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

The description provides no guidance about when to use this tool versus alternatives like 'get_aprs_position' or 'track_multiple_callsigns'. There's no mention of prerequisites, constraints, or typical use cases beyond the basic functionality stated.

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/dhhuston/APRSFI-MCP-SERVER'

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