Skip to main content
Glama

search_fred_series

Find economic time series in the FRED database by keyword search, returning popular series IDs when the exact identifier is unknown.

Instructions

Search the FRED catalog (800K+ economic time series) by keyword. Returns series IDs ranked by popularity. Use this when you don't know the exact series_id for an indicator.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch keywords (e.g. "treasury yield", "korea unemployment", "high yield spread")
limitNoMax results (default 20)

Implementation Reference

  • Core FRED API client method that calls FRED /series/search endpoint with a query, limit, ordered by popularity descending, returning FredSearchResult[].
    const searchSeries = async (query: string, limit = 20): Promise<FredSearchResult[]> => {
      const data = await get<{ seriess: RawSeriesEntry[] }>('/series/search', {
        search_text: query,
        limit: String(limit),
        order_by: 'popularity',
        sort_order: 'desc',
      });
      return data.seriess.map((s) => ({
        id: s.id,
        title: s.title,
        units: s.units,
        frequency: s.frequency,
        last_updated: s.last_updated,
        popularity: s.popularity ?? 0,
      }));
    };
  • MCP tool handler for 'search_fred_series'. Defines tool registration, Zod schema (query string, limit number 1-100 default 20), and callback that gets FRED API key, creates client, and returns search results.
    server.tool(
      'search_fred_series',
      "Search the FRED catalog (800K+ economic time series) by keyword. Returns series IDs ranked by popularity. Use this when you don't know the exact series_id for an indicator.",
      {
        query: z
          .string()
          .describe(
            'Search keywords (e.g. "treasury yield", "korea unemployment", "high yield spread")',
          ),
        limit: z.number().int().min(1).max(100).default(20).describe('Max results (default 20)'),
      },
      async ({ query, limit }) => {
        const apiKey = getFredKey();
        if (!apiKey) return err('FRED API key not set. Run: firma config set fred-key <your-key>');
        try {
          const client = createFredClient(apiKey);
          const results = await client.searchSeries(query, limit);
          return ok(results);
        } catch (e) {
          return err(e instanceof Error ? e.message : 'Failed to search FRED');
        }
      },
  • Type definition for search results returned by the FRED search operation.
    export type FredSearchResult = {
      id: string;
      title: string;
      units: string;
      frequency: string;
      last_updated: string;
      popularity: number;
    };
  • Top-level registration call that wires the search_fred_series tool (among others) into the MCP server.
    registerMacroTools(server);
  • Zod input schema for the search_fred_series tool: a required query string and optional limit (1-100, default 20).
    {
      query: z
        .string()
        .describe(
          'Search keywords (e.g. "treasury yield", "korea unemployment", "high yield spread")',
        ),
      limit: z.number().int().min(1).max(100).default(20).describe('Max results (default 20)'),
    },
Behavior4/5

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

With no annotations, the description carries full burden. It correctly states the tool is a search operation (read-only, non-destructive) and returns series IDs by popularity. Could mention that it searches the FRED catalog but does not retrieve actual time series data. Still, the description sufficiently conveys the behavior.

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 purpose in the first sentence and usage guidance in the second. Every word earns its place. No redundancy or fluff.

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?

For a search tool with 2 simple parameters and no output schema, the description is sufficient. It explains what it does and when to use it. Could optionally mention that results include series ID and popularity rank, but not essential for correctness. Adequate given complexity.

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 coverage is 100%, so the baseline is 3. The description adds no new meaning for parameters beyond 'by keyword' for the query parameter, which is already clear from the schema. The limit parameter is not mentioned in the description. No meaningful addition beyond schema.

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 verb 'search' and the resource 'FRED catalog (800K+ economic time series)'. It specifies the output: 'Returns series IDs ranked by popularity.' It distinguishes from sibling `fetch_fred_series` by explicitly stating when to use: 'when you don't know the exact series_id for an indicator.'

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit usage guidance: 'Use this when you don't know the exact series_id for an indicator.' This implies the alternative tool `fetch_fred_series` should be used when the series_id is known. No other exclusions needed.

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/evan-moon/firma'

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