Skip to main content
Glama
MaxwellCalkin

N2YO Satellite Tracker MCP Server

query_satellites_with_tle

Find satellites using natural language queries and retrieve structured data with names and TLE (Two-Line Element) information. Filter by category and control result count for satellite tracking.

Instructions

Find satellites by natural language query and return structured data with Name and TLE

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language query about satellites (e.g., 'ISS', 'Starlink satellites over California', 'military satellites')
categoryFilterNoOptional filter for satellite categoryall
maxResultsNoMaximum number of satellites to return (default: 10)

Implementation Reference

  • Primary implementation of the tool handler. Queries satellites using natural language via querySatellitesNatural, fetches TLE for each using getSatelliteTle, and structures the response with names and TLE data.
    private async querySatellitesWithTle(query: string, categoryFilter: string = "all", maxResults: number = 10): Promise<CallToolResult> {
      try {
        // First, use the existing natural language query to find satellites
        const naturalQueryResult = await this.querySatellitesNatural(query, categoryFilter);
        
        if (naturalQueryResult.isError) {
          return naturalQueryResult;
        }
    
        // Parse the response to extract satellite data
        const responseText = naturalQueryResult.content[0]?.text;
        if (typeof responseText !== 'string') {
          throw new Error('Invalid response format from natural query');
        }
        const naturalData = JSON.parse(responseText);
        const satellites = naturalData.satellites || [];
    
        // Limit results
        const limitedSatellites = satellites.slice(0, maxResults);
    
        // Get TLE data for each satellite
        const satellitesWithTle = [];
        for (const satellite of limitedSatellites) {
          try {
            const tleResult = await this.getSatelliteTle(String(satellite.noradId));
            if (!tleResult.isError) {
              const tleResponseText = tleResult.content[0]?.text;
              if (typeof tleResponseText !== 'string') {
                continue;
              }
              const tleData = JSON.parse(tleResponseText);
              satellitesWithTle.push({
                name: satellite.name,
                noradId: String(satellite.noradId),
                tle: tleData,
                position: satellite.position,
                launchDate: satellite.launchDate,
                internationalDesignator: satellite.internationalDesignator,
              });
            }
          } catch (error) {
            // Skip satellites that don't have TLE data available
            console.warn(`Could not get TLE for satellite ${satellite.noradId}: ${error}`);
          }
        }
    
        // Return structured response
        const response = {
          query: query,
          location: naturalData.location,
          time: naturalData.time,
          categoryFilter: categoryFilter,
          satellites: satellitesWithTle,
          count: satellitesWithTle.length,
          totalFound: satellites.length,
          summary: `Found ${satellitesWithTle.length} satellites with TLE data (${satellites.length} total matches)`,
        };
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response, null, 2),
            },
          ],
        };
    
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error processing query with TLE: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/server.ts:64-88 (registration)
    Tool registration in the getTools() method of N2YOServer class, defining the tool name, description, and input schema.
    {
      name: "query_satellites_with_tle",
      description: "Find satellites by natural language query and return structured data with Name and TLE",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "Natural language query about satellites (e.g., 'ISS', 'Starlink satellites over California', 'military satellites')",
          },
          categoryFilter: {
            type: "string",
            enum: ["all", "military", "weather", "gps", "amateur", "starlink", "space-stations"],
            default: "all",
            description: "Optional filter for satellite category",
          },
          maxResults: {
            type: "number",
            default: 10,
            description: "Maximum number of satellites to return (default: 10)",
          },
        },
        required: ["query"],
      },
    },
  • Dispatcher case in the callTool method that routes calls to the specific handler method.
    case "query_satellites_with_tle":
      return await this.querySatellitesWithTle(args.query, args.categoryFilter, args.maxResults);
Behavior2/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 mentions returning structured data with Name and TLE, but lacks critical behavioral details such as data source, accuracy, rate limits, authentication needs, error handling, or whether it performs real-time queries versus cached data. For a query tool with zero annotation coverage, this is insufficient.

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 front-loads the core functionality ('Find satellites by natural language query') and specifies the return format. There is no wasted language or redundancy.

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?

Given the complexity of satellite data querying, no annotations, and no output schema, the description is incomplete. It fails to explain the return structure beyond 'Name and TLE', doesn't address data freshness or limitations, and offers no context on how natural language queries are processed. This leaves significant gaps for an agent to use the tool effectively.

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?

Schema description coverage is 100%, so the schema fully documents all three parameters. The description adds no additional meaning beyond implying natural language querying, which is already covered in the schema's 'query' parameter description. Baseline score of 3 is appropriate as the schema does the heavy lifting.

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 ('Find satellites by natural language query') and the resource ('satellites'), specifying that it returns structured data with Name and TLE. It distinguishes from some siblings like 'get_satellite_position' or 'get_radio_passes' by focusing on query-based retrieval, though it doesn't explicitly differentiate from 'query_satellites_natural' which appears similar.

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 on when to use this tool versus alternatives. With many sibling tools available (e.g., 'get_satellites_by_category', 'search_satellites_by_name', 'query_satellites_natural'), there is no mention of specific use cases, prerequisites, or comparisons to help an agent choose appropriately.

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/MaxwellCalkin/N2YO-MCP'

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