Skip to main content
Glama
lalrow

AI Makerspace MCP Demo Server

by lalrow

space_fact

Retrieve NASA's Astronomy Picture of the Day with title, date, explanation, and image URL to explore daily space imagery and information.

Instructions

Get NASA's Astronomy Picture of the Day (APOD) with its title, date, description, and image URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:43-67 (handler)
    The handler function for the 'space_fact' tool, decorated with @mcp.tool() to register and implement fetching NASA's Astronomy Picture of the Day (APOD), including title, date, explanation, and image URL.
    @mcp.tool()
    def space_fact() -> str:
        """Get NASA's Astronomy Picture of the Day (APOD) with its title, date, description, and image URL."""
        try:
            api_key = os.getenv("NASA_API_KEY", "DEMO_KEY")  # fallback if not set
            url = f"https://api.nasa.gov/planetary/apod?api_key={api_key}"
            response = requests.get(url)
            if response.status_code == 200:
                data = response.json()
                title = data.get("title", "Unknown Title")
                explanation = data.get("explanation", "No description available.")
                date = data.get("date", "")
                image_url = data.get("hdurl") or data.get("url")  # sometimes only 'url' exists
    
                message = (
                    f"🪐 **{title}** ({date})\n\n"
                    f"{explanation}\n\n"
                    f"📸 Image URL: {image_url}"
                )
                return message
            else:
                return f"⚠️ NASA API error: {response.status_code}"
        except Exception as e:
            return f"❌ Something went wrong: {e}"
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the tool's function and output format, but does not mention behavioral traits such as rate limits, authentication needs, or potential errors. It adds basic context but lacks depth for a tool with no annotation coverage.

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 key action ('Get NASA's Astronomy Picture of the Day') and lists the returned fields. Every word contributes to understanding the tool's function, with zero waste or redundancy.

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

Completeness4/5

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

Given the tool's low complexity (0 parameters, no annotations, but has an output schema), the description is complete enough for basic use. It specifies what the tool does and what data it returns, which aligns with the presence of an output schema. However, it could benefit from more behavioral context, such as noting it's a read-only API call or potential limitations.

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

Parameters4/5

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

The tool has 0 parameters, and the input schema has 100% description coverage (though empty). The description does not need to compensate for any parameter gaps, as there are none. It appropriately focuses on the tool's purpose and output without unnecessary parameter details.

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 specific action ('Get NASA's Astronomy Picture of the Day') and resource (APOD), including the exact data returned (title, date, description, image URL). It effectively distinguishes this tool from sibling tools like 'animal_fact' or 'science_term' by specifying its unique domain and content.

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 context by specifying what the tool retrieves (APOD with specific fields), but it does not explicitly state when to use this tool versus alternatives like 'science_term' or 'web_search'. No exclusions or prerequisites are mentioned, leaving usage guidance at an implied level.

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/lalrow/AIE8-MCP-Session'

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