Skip to main content
Glama
guillochon

mlb-api-mcp

get_mlb_linescore

Retrieve detailed inning-by-inning scoring data for MLB games using game IDs to analyze game progress and outcomes.

Instructions

Get linescore for a specific game by game_id.

Args: game_id (int): The game ID.

Returns: dict: Linescore information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
game_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'get_mlb_linescore' tool, decorated with @mcp.tool() which registers it as an MCP tool. It retrieves the linescore data for a given MLB game ID using the MLB API.
    @mcp.tool()
    def get_mlb_linescore(game_id: int) -> dict:
        """
        Get linescore for a specific game by game_id.
    
        Args:
            game_id (int): The game ID.
    
        Returns:
            dict: Linescore information.
        """
        try:
            linescore = mlb.get_game_line_score(game_id)
            return linescore
        except Exception as e:
            return {"error": str(e)}
Behavior2/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 mentions the return type ('dict: Linescore information') but lacks details on error handling, rate limits, authentication needs, or what specific data the linescore includes. This is insufficient 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, followed by structured Args and Returns sections. It's efficient with minimal waste, though the Args section could be slightly more detailed given the lack of schema descriptions.

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 tool's moderate complexity (retrieving sports data), no annotations, and an output schema present, the description is minimally adequate. It covers the basic purpose and parameter but lacks behavioral details and usage guidance, leaving gaps in completeness.

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 description adds meaningful context for the single parameter by specifying that game_id is an integer used to identify a specific game, which clarifies its purpose beyond the schema's basic type definition. Since there's only one parameter and schema description coverage is 0%, this compensation is adequate.

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 linescore') and the target resource ('for a specific game by game_id'), making the purpose immediately understandable. It distinguishes from siblings like get_mlb_boxscore or get_mlb_game_scoring_plays by specifying it retrieves linescore information, though it doesn't explicitly contrast with them.

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 like get_mlb_boxscore or get_mlb_game_scoring_plays, nor does it mention prerequisites or context for usage. It simply states what it does without indicating appropriate scenarios.

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/guillochon/mlb-api-mcp'

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