Skip to main content
Glama

list_series

Browse and filter Bureau of Labor Statistics data series by category to identify relevant economic indicators like CPI and employment statistics for analysis.

Instructions

List available BLS data series with optional category filtering. Returns series metadata including titles, IDs, and categories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by category (e.g., 'CPI', 'Employment'). Optional.
limitNoMaximum number of results to return (default: 50)

Implementation Reference

  • The execute method of ListSeriesTool, which validates input, calls the data provider's list_series method, and returns formatted results or errors.
    async def execute(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
        """Execute list_series tool."""
        logger.info(f"Executing list_series with arguments: {arguments}")
    
        # Validate input
        try:
            input_data = ListSeriesInput(**arguments)
        except Exception as e:
            logger.error(f"Input validation failed: {e}")
            return {"error": f"Invalid input: {str(e)}"}
    
        # Validate limit
        is_valid, error_msg = validate_limit(input_data.limit)
        if not is_valid:
            return {"error": error_msg}
    
        # List series
        try:
            series_list = await self.data_provider.list_series(
                category=input_data.category, limit=input_data.limit
            )
            logger.info(f"Successfully listed {len(series_list)} series")
            return {
                "series": series_list,
                "count": len(series_list),
                "category_filter": input_data.category,
            }
        except Exception as e:
            logger.error(f"Error listing series: {e}")
            return {"error": f"Failed to list series: {str(e)}"}
  • Pydantic BaseModel defining the input schema for the list_series tool, with optional category filter and limit.
    class ListSeriesInput(BaseModel):
        """Input schema for list_series tool."""
    
        category: Optional[str] = Field(
            default=None,
            description="Filter by category (e.g., 'CPI', 'Employment'). Optional.",
        )
        limit: int = Field(
            default=50, description="Maximum number of results to return (default: 50)"
        )
  • Registration of all tools including list_series in the BLSMCPServer's tools dictionary, instantiated with the data provider.
    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),
    }
  • The MockDataProvider.list_series method that loads the series catalog from fixtures, filters by category if provided, applies the limit, and returns the list of series metadata.
    async def list_series(
        self, category: str | None = None, limit: int = 50
    ) -> list[dict[str, Any]]:
        """
        List available series with optional filtering.
    
        Args:
            category: Optional category filter (e.g., 'CPI')
            limit: Maximum number of results
    
        Returns:
            List of series metadata dictionaries
        """
        catalog = self._load_series_catalog()
        series_list = catalog["series"]
    
        # Filter by category if specified
        if category:
            series_list = [
                s for s in series_list if s.get("category", "").upper() == category.upper()
            ]
    
        # Apply limit
        series_list = series_list[:limit]
    
        return list(series_list)
Behavior3/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 discloses that the tool returns 'series metadata including titles, IDs, and categories,' which adds behavioral context beyond the input schema. However, it doesn't mention other traits like rate limits, authentication needs, pagination behavior, or potential errors, leaving gaps for a mutation-free but data-heavy tool.

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 two sentences, front-loaded with the core purpose and followed by return details. Every sentence earns its place: the first defines the action and optional filtering, the second specifies the output. There is no wasted verbiage, making it highly efficient and easy to parse.

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 (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the purpose and output type but lacks details on behavioral aspects like response format, error handling, or usage constraints. Without annotations or output schema, more context would improve completeness for effective agent use.

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 both parameters ('category' and 'limit') well-documented in the schema. The description adds minimal value beyond the schema by mentioning 'optional category filtering' and 'Returns series metadata,' but doesn't provide additional semantics like format examples or usage nuances. This 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 tool's purpose: 'List available BLS data series with optional category filtering.' It specifies the verb ('List'), resource ('BLS data series'), and scope ('with optional category filtering'), and distinguishes it from siblings like 'get_series' or 'plot_series' by focusing on listing metadata rather than retrieving or visualizing data. However, it doesn't explicitly differentiate from 'get_series_info', which might also involve metadata, keeping it from a perfect score.

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 by mentioning 'optional category filtering,' suggesting it's for browsing series with potential filtering. It doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_series' or 'plot_series,' nor does it state any prerequisites or exclusions. The context is clear but lacks detailed alternatives or when-not-to-use advice.

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