Skip to main content
Glama

jpl_jd_cal

Convert between Julian Day numbers and calendar dates for astronomical calculations and timekeeping in space missions.

Instructions

Julian Day number to/from calendar date/time converter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jdNoJulian date to convert to calendar date
cdNoCalendar date to convert to Julian date (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss format)

Implementation Reference

  • The core handler function `jdCalHandler` that executes the `jpl_jd_cal` tool. It validates input, transforms parameters, calls the JPL JD Calendar API, adds result as resource, and returns formatted JSON response.
    export async function jdCalHandler(args: Record<string, any>) {
      try {
        // Base URL for the JD Calendar API
        const baseUrl = 'https://ssd-api.jpl.nasa.gov/jd_cal.api';
        
        // Validate parameters
        if (!args.jd && !args.cd) {
          return {
            content: [{
              type: "text",
              text: "Error: Either a Julian date (jd) or calendar date (cd) must be provided."
            }],
            isError: true
          };
        }
        
        // Transform parameter names from underscore to hyphenated format
        const transformedParams = transformParamsToHyphenated(args);
        
        // Make the API request
        const response = await axios.get(baseUrl, { params: transformedParams });
        const data = response.data;
        
        // Add response to resources
        const resourceUri = `jpl://jd_cal/${args.jd || args.cd}`;
        addResource(resourceUri, {
          name: `Julian Date / Calendar Date Conversion: ${args.jd || args.cd}`,
          mimeType: "application/json",
          text: JSON.stringify(data, null, 2)
        });
        
        // Format the response
        return {
          content: [{
            type: "text",
            text: JSON.stringify(data, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{
            type: "text",
            text: `Error accessing JPL Julian Date Calendar API: ${error.message}`
          }],
          isError: true
        };
      }
    }
  • Input schema definition for the `jpl_jd_cal` tool in the tools/list response, specifying parameters `jd` and `cd`.
      name: "jpl_jd_cal",
      description: "Julian Day number to/from calendar date/time converter",
      inputSchema: {
        type: "object",
        properties: {
          jd: {
            type: "string",
            description: "Julian date to convert to calendar date"
          },
          cd: {
            type: "string",
            description: "Calendar date to convert to Julian date (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss format)"
          }
        }
      }
    },
  • src/index.ts:513-516 (registration)
    Registration of the `jpl_jd_cal` tool in the tools/manifest response, providing name, id, and description.
      name: "jpl_jd_cal",
      id: "jpl/jd_cal",
      description: "Julian Day number to/from calendar date/time converter"
    },
  • src/index.ts:2110-2116 (registration)
    Global registration of `mcp__jpljd_cal` tool wrapper that delegates to the `jpl/jd_cal` handler.
    registerGlobalTool('mcp__jpljd_cal', async (args: Record<string, any>) => {
      serverInstance?.sendLoggingMessage({
        level: "info",
        data: `MCP JPL JD Calendar called with args: ${JSON.stringify(args)}`,
      });
      return await handleToolCall('jpl/jd_cal', args);
    });
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 of behavioral disclosure. It states the conversion function but doesn't cover error handling, input validation, performance characteristics, or output format. For a tool with no annotations, this leaves significant gaps in understanding how it behaves beyond the basic operation.

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 directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy for an agent to quickly understand the core functionality.

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 no annotations, no output schema, and a tool that performs conversions (which may involve error cases or format specifics), the description is incomplete. It doesn't explain what the output looks like, how to handle invalid inputs, or any limitations, making it inadequate for full contextual understanding.

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 both parameters (jd and cd) with their purposes and formats. The description adds no additional parameter semantics beyond what's in the schema, such as examples, constraints, or interdependencies, meeting the baseline for high schema coverage.

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 tool's function as a converter between Julian Day numbers and calendar date/time, using specific verbs ('to/from converter'). It distinguishes from most siblings by focusing on date conversion rather than astronomical data retrieval or imagery, though it doesn't explicitly differentiate from similar conversion tools if any exist.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, typical use cases, or how it compares to other date conversion methods or tools in the sibling list, leaving the agent to infer usage context.

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/ProgramComputer/NASA-MCP-server'

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