Skip to main content
Glama
gregario

astronomy-oracle

search_objects

Search astronomical catalogs to find celestial objects by type, constellation, brightness, size, or catalog membership. Returns a sorted table of matching objects for observation planning.

Instructions

Search and filter the celestial object catalog by type, constellation, magnitude, angular size, or catalog membership. Returns a formatted table of matching objects sorted by brightness.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoObject type code (e.g. G=Galaxy, PN=Planetary Nebula, OCl=Open Cluster)
constellationNoIAU constellation abbreviation (e.g. Ori, And, Sgr)
maxMagnitudeNoMaximum (faintest) visual magnitude to include
minMagnitudeNoMinimum (brightest) visual magnitude to include
minSizeNoMinimum angular size in arcminutes
catalogNoFilter by catalog membership
limitNoMaximum number of results (default 20, max 100)

Implementation Reference

  • The registerSearchObjects function defines the search_objects tool and its execution logic within the MCP server.
    export function registerSearchObjects(server: McpServer): void {
      server.tool(
        "search_objects",
        "Search and filter the celestial object catalog by type, constellation, magnitude, angular size, or catalog membership. Returns a formatted table of matching objects sorted by brightness.",
        {
          type: z
            .enum(typeKeys)
            .optional()
            .describe("Object type code (e.g. G=Galaxy, PN=Planetary Nebula, OCl=Open Cluster)"),
          constellation: z
            .string()
            .optional()
            .describe("IAU constellation abbreviation (e.g. Ori, And, Sgr)"),
          maxMagnitude: z
            .number()
            .optional()
            .describe("Maximum (faintest) visual magnitude to include"),
          minMagnitude: z
            .number()
            .optional()
            .describe("Minimum (brightest) visual magnitude to include"),
          minSize: z
            .number()
            .optional()
            .describe("Minimum angular size in arcminutes"),
          catalog: z
            .enum(["messier", "caldwell", "ngc", "ic"])
            .optional()
            .describe("Filter by catalog membership"),
          limit: z
            .number()
            .min(1)
            .max(100)
            .optional()
            .describe("Maximum number of results (default 20, max 100)"),
        },
        async (params) => {
          const store = await getCatalog();
          const {
            type,
            constellation,
            maxMagnitude,
            minMagnitude,
            minSize,
            catalog: catalogFilter,
            limit,
          } = params as {
            type?: string;
            constellation?: string;
            maxMagnitude?: number;
            minMagnitude?: number;
            minSize?: number;
            catalog?: string;
            limit?: number;
          };
    
          const maxResults = limit ?? 20;
    
          let results = [...store.all.values()];
    
          // Filter by type
          if (type) {
            results = results.filter((obj) => obj.type === type as ObjectTypeCode);
          }
    
          // Filter by constellation
          if (constellation) {
            const lc = constellation.toLowerCase();
            results = results.filter(
              (obj) => obj.constellation.toLowerCase() === lc,
            );
          }
    
          // Filter by max magnitude (faintest)
          if (maxMagnitude !== undefined) {
            results = results.filter(
              (obj) => obj.magnitude !== null && obj.magnitude <= maxMagnitude,
            );
          }
    
          // Filter by min magnitude (brightest)
          if (minMagnitude !== undefined) {
            results = results.filter(
              (obj) => obj.magnitude !== null && obj.magnitude >= minMagnitude,
            );
          }
    
          // Filter by minimum angular size
          if (minSize !== undefined) {
            results = results.filter(
              (obj) => obj.majorAxis !== null && obj.majorAxis >= minSize,
            );
          }
    
          // Filter by catalog
          if (catalogFilter) {
            switch (catalogFilter) {
              case "messier":
                results = results.filter((obj) => obj.messier !== null);
                break;
              case "ngc":
                results = results.filter((obj) => obj.name.startsWith("NGC"));
                break;
              case "ic":
                results = results.filter((obj) => obj.name.startsWith("IC"));
                break;
              case "caldwell":
                // Caldwell objects have "C" in otherIdentifiers — approximate
                results = results.filter(
                  (obj) =>
                    obj.otherIdentifiers !== null &&
                    /\bC\d+\b/.test(obj.otherIdentifiers),
                );
                break;
            }
          }
    
          // Sort by magnitude (brightest first, nulls last)
          results.sort((a, b) => {
            if (a.magnitude === null && b.magnitude === null) return 0;
            if (a.magnitude === null) return 1;
            if (b.magnitude === null) return -1;
            return a.magnitude - b.magnitude;
          });
    
          // Apply limit
          results = results.slice(0, maxResults);
    
          return {
            content: [
              {
                type: "text" as const,
                text: formatSearchResults(results),
              },
            ],
          };
        },
      );
    }
  • Input schema validation for the search_objects tool using Zod.
    {
      type: z
        .enum(typeKeys)
        .optional()
        .describe("Object type code (e.g. G=Galaxy, PN=Planetary Nebula, OCl=Open Cluster)"),
      constellation: z
        .string()
        .optional()
        .describe("IAU constellation abbreviation (e.g. Ori, And, Sgr)"),
      maxMagnitude: z
        .number()
        .optional()
        .describe("Maximum (faintest) visual magnitude to include"),
      minMagnitude: z
        .number()
        .optional()
        .describe("Minimum (brightest) visual magnitude to include"),
      minSize: z
        .number()
        .optional()
        .describe("Minimum angular size in arcminutes"),
      catalog: z
        .enum(["messier", "caldwell", "ngc", "ic"])
        .optional()
        .describe("Filter by catalog membership"),
      limit: z
        .number()
        .min(1)
        .max(100)
        .optional()
        .describe("Maximum number of results (default 20, max 100)"),
    },
  • Registration of the search_objects tool in the main application entry point.
    import { registerSearchObjects } from "./tools/search-objects.js";
    import { registerPlanSession } from "./tools/plan-session.js";
    
    export function registerTools(server: McpServer): void {
      registerLookupObject(server);
      registerSearchObjects(server);
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 the return format ('formatted table') and sorting ('by brightness'), but does not disclose critical behavioral traits such as pagination, rate limits, authentication requirements, error handling, or whether the search is case-sensitive. This leaves significant gaps for an agent to understand the tool's behavior.

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, well-structured sentence that efficiently conveys the tool's purpose, filtering criteria, and output format. It is front-loaded with the core functionality and avoids unnecessary details, making it highly concise and clear.

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 complexity (7 parameters, no annotations, no output schema), the description is adequate but incomplete. It covers the basic purpose and output format, but lacks details on behavioral aspects like pagination, error handling, or performance characteristics. Without annotations or an output schema, more context would be helpful 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 already documents all parameters thoroughly. The description adds marginal value by listing the filterable attributes (type, constellation, magnitude, etc.), but does not provide additional semantics beyond what the schema specifies. 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.

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: 'Search and filter the celestial object catalog' with specific criteria (type, constellation, magnitude, etc.) and indicates the output format ('formatted table of matching objects sorted by brightness'). It distinguishes from sibling tools like 'lookup_object' (likely for single object lookup) and 'plan_session' (likely for observation planning).

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

Usage Guidelines3/5

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

The description implies usage for searching with multiple filters, but does not explicitly state when to use this tool versus alternatives like 'lookup_object' or 'plan_session'. It provides context for filtering but lacks explicit guidance on exclusions or prerequisites.

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/gregario/astronomy-oracle'

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