Skip to main content
Glama

get_article_ids

Fetch article IDs from an Inoreader stream for counting or batch operations without retrieving full content.

Instructions

Lightweight fetch of article IDs from a stream without full content. Useful for counting or batch operations. Costs 1 Zone 1 request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stream_idNoStream ID (defaults to all items)
countNoNumber of IDs to fetch (default 1000, max 10000)
filterNoFilter by status
sinceNoISO date - only items after this date
continuationNoContinuation token for pagination

Implementation Reference

  • The handler function that executes get_article_ids logic. Accepts optional stream_id, count, filter, since, and continuation parameters. Makes an API call to /reader/api/0/stream/items/ids and returns article IDs, count, and continuation token.
    async (params) => {
      const streamId = params.stream_id ?? "user/-/state/com.google/reading-list";
      const queryParams: Record<string, string> = {
        output: "json",
        n: String(params.count ?? 1000),
        s: streamId,
      };
    
      if (params.continuation) queryParams.c = params.continuation;
      if (params.since) {
        queryParams.ot = String(Math.floor(new Date(params.since).getTime() / 1000));
      }
      if (params.filter === "unread") {
        queryParams.xt = "user/-/state/com.google/read";
      } else if (params.filter === "starred") {
        queryParams.it = "user/-/state/com.google/starred";
      }
    
      const data = await apiGet<StreamItemIdsResponse>(
        "/reader/api/0/stream/items/ids",
        queryParams
      );
    
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(
              {
                ids: data.itemRefs.map((r) => r.id),
                count: data.itemRefs.length,
                continuation: data.continuation ?? null,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • Zod schema defining input validation for get_article_ids tool. Parameters include stream_id (optional string), count (number 1-10000), filter (enum: all/unread/starred), since (ISO date), and continuation (pagination token).
    {
      stream_id: z
        .string()
        .optional()
        .describe("Stream ID (defaults to all items)"),
      count: z
        .number()
        .min(1)
        .max(10000)
        .optional()
        .describe("Number of IDs to fetch (default 1000, max 10000)"),
      filter: z
        .enum(["all", "unread", "starred"])
        .optional()
        .describe("Filter by status"),
      since: z
        .string()
        .optional()
        .describe("ISO date - only items after this date"),
      continuation: z
        .string()
        .optional()
        .describe("Continuation token for pagination"),
    },
  • MCP server.tool() registration for get_article_ids. Registers the tool with name 'get_article_ids', description, schema, and handler function. Uses server.tool() method from @modelcontextprotocol/sdk.
    server.tool(
      "get_article_ids",
      "Lightweight fetch of article IDs from a stream without full content. Useful for counting or batch operations. Costs 1 Zone 1 request.",
      {
        stream_id: z
          .string()
          .optional()
          .describe("Stream ID (defaults to all items)"),
        count: z
          .number()
          .min(1)
          .max(10000)
          .optional()
          .describe("Number of IDs to fetch (default 1000, max 10000)"),
        filter: z
          .enum(["all", "unread", "starred"])
          .optional()
          .describe("Filter by status"),
        since: z
          .string()
          .optional()
          .describe("ISO date - only items after this date"),
        continuation: z
          .string()
          .optional()
          .describe("Continuation token for pagination"),
      },
      async (params) => {
        const streamId = params.stream_id ?? "user/-/state/com.google/reading-list";
        const queryParams: Record<string, string> = {
          output: "json",
          n: String(params.count ?? 1000),
          s: streamId,
        };
    
        if (params.continuation) queryParams.c = params.continuation;
        if (params.since) {
          queryParams.ot = String(Math.floor(new Date(params.since).getTime() / 1000));
        }
        if (params.filter === "unread") {
          queryParams.xt = "user/-/state/com.google/read";
        } else if (params.filter === "starred") {
          queryParams.it = "user/-/state/com.google/starred";
        }
    
        const data = await apiGet<StreamItemIdsResponse>(
          "/reader/api/0/stream/items/ids",
          queryParams
        );
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(
                {
                  ids: data.itemRefs.map((r) => r.id),
                  count: data.itemRefs.length,
                  continuation: data.continuation ?? null,
                },
                null,
                2
              ),
            },
          ],
        };
      }
    );
  • Type definition for StreamItemIdsResponse - the API response type used by get_article_ids. Contains itemRefs array with id and timestampUsec, plus optional continuation token.
    export interface StreamItemIdsResponse {
      itemRefs: Array<{ id: string; timestampUsec: string }>;
      continuation?: string;
    }
  • src/index.ts:6-6 (registration)
    Import statement that brings in registerReadingTools function which contains the get_article_ids tool registration. Called on line 63 to register all reading tools with the MCP server.
    import { registerReadingTools } from "./tools/reading.js";
Behavior4/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 effectively describes the lightweight nature of the operation, the cost implications, and the purpose (counting/batch operations). However, it doesn't mention pagination behavior (implied by continuation parameter) or error conditions.

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 extremely efficient - three sentences with zero waste. Each sentence adds distinct value: purpose, use cases, and cost information. It's perfectly front-loaded with the core functionality.

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 read-only tool with no output schema, the description provides good context about what the tool returns (IDs only, not full content) and its use cases. It could be more complete by mentioning the return format (e.g., list of IDs) or pagination details, but the cost information and lightweight nature are valuable additions.

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%, so the schema already documents all 5 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema, maintaining the baseline score of 3 for high schema coverage.

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 ('Lightweight fetch'), resource ('article IDs from a stream'), and scope ('without full content'). It distinguishes from siblings like 'get_articles' (which presumably fetches full content) by emphasizing lightweight ID-only retrieval.

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 explicitly states when to use this tool ('Useful for counting or batch operations') and provides cost information ('Costs 1 Zone 1 request'), which helps the agent decide when this tool is appropriate versus alternatives. It clearly differentiates from content-heavy operations.

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/justmytwospence/inoreader-mcp'

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