Skip to main content
Glama

get_series_info

Retrieve metadata for Bureau of Labor Statistics data series, including title, description, category, and availability details.

Instructions

Get detailed metadata information about a specific BLS series. Returns series title, description, category, and data availability.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
series_idYesBLS series ID (e.g., 'CUUR0000SA0')

Implementation Reference

  • GetSeriesInfoTool class: implements the core logic for the get_series_info tool, including name, description, input_schema properties, and the async execute method that handles input validation and delegates to data provider.
    class GetSeriesInfoTool(BaseTool):
        """Tool for getting BLS series metadata."""
    
        def __init__(self, data_provider: MockDataProvider) -> None:
            """Initialize tool with data provider."""
            self.data_provider = data_provider
    
        @property
        def name(self) -> str:
            return "get_series_info"
    
        @property
        def description(self) -> str:
            return (
                "Get detailed metadata information about a specific BLS series. "
                "Returns series title, description, category, and data availability."
            )
    
        @property
        def input_schema(self) -> type[BaseModel]:
            return GetSeriesInfoInput
    
        async def execute(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
            """Execute get_series_info tool."""
            logger.info(f"Executing get_series_info with arguments: {arguments}")
    
            # Validate input
            try:
                input_data = GetSeriesInfoInput(**arguments)
            except Exception as e:
                logger.error(f"Input validation failed: {e}")
                return {"error": f"Invalid input: {str(e)}"}
    
            # Validate series ID format
            if not validate_series_id(input_data.series_id):
                return {"error": f"Invalid series ID format: {input_data.series_id}"}
    
            # Get series info
            try:
                info = await self.data_provider.get_series_info(
                    series_id=input_data.series_id
                )
                logger.info(f"Successfully retrieved info for {input_data.series_id}")
                return info
            except ValueError as e:
                logger.warning(f"Series not found: {e}")
                return {"error": str(e)}
            except Exception as e:
                logger.error(f"Error getting series info: {e}")
                return {"error": f"Failed to get series info: {str(e)}"}
  • Pydantic BaseModel defining the input schema: requires a 'series_id' string field.
    class GetSeriesInfoInput(BaseModel):
        """Input schema for get_series_info tool."""
    
        series_id: str = Field(description="BLS series ID (e.g., 'CUUR0000SA0')")
  • Tool registration: GetSeriesInfoTool instance added to the server's tools dictionary under the key 'get_series_info'.
    self.tools = {
        "get_series": GetSeriesTool(self.data_provider),
        "list_series": ListSeriesTool(self.data_provider),
        "get_series_info": GetSeriesInfoTool(self.data_provider),
        "plot_series": PlotSeriesTool(self.data_provider),
    }
  • MockDataProvider.get_series_info: supporting method that loads series metadata from JSON fixtures and augments with data availability info.
    async def get_series_info(self, series_id: str) -> dict[str, Any]:
        """
        Get metadata information about a specific series.
    
        Args:
            series_id: BLS series ID
    
        Returns:
            Dictionary with series metadata
    
        Raises:
            ValueError: If series not found
        """
        catalog = self._load_series_catalog()
    
        for series in catalog["series"]:
            if series["series_id"] == series_id:
                # Get data point count
                historical = self._load_historical_data()
                data_count = 0
                if series_id in historical:
                    data_count = len(historical[series_id]["data"])
    
                return {
                    **series,
                    "data_point_count": data_count,
                    "available_data": series_id in historical,
                }
    
        raise ValueError(f"Series '{series_id}' not found")
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 values but doesn't disclose behavioral traits such as error handling, rate limits, authentication needs, or whether it's a read-only operation. The description is minimal beyond stating the purpose.

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 purpose and return values. There is no wasted text, making it appropriately sized and structured.

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 low complexity (single parameter, no output schema, no annotations), the description is adequate but has gaps. It covers the purpose and return values, but lacks behavioral context and usage guidelines, which are important for completeness in this context.

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%, with the parameter 'series_id' well-documented in the schema (including an example). The description adds no additional parameter semantics beyond what the schema provides, so it meets 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 verb 'Get' and resource 'detailed metadata information about a specific BLS series', specifying what it returns (title, description, category, data availability). However, it doesn't explicitly differentiate from sibling tools like 'get_series' or 'list_series', which likely have overlapping purposes.

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 like 'get_series', 'list_series', or 'plot_series'. The description implies usage for retrieving metadata, but lacks explicit context or exclusions for sibling tools.

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/kovashikawa/bls_mcp'

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