Skip to main content
Glama

getAllSpecs

Read-onlyIdempotent

Retrieves all API specifications in a workspace, supporting cursor-based pagination to manage large result sets.

Instructions

Gets all API specifications in a workspace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdYesThe workspace's ID.
cursorNoThe pointer to the first record of the set of paginated results. To view the next response, use the `nextCursor` value for this parameter.
limitNoThe maximum number of rows to return in the response.

Implementation Reference

  • The handler function that executes the getAllSpecs tool logic. It makes a GET request to /specs endpoint with workspaceId, cursor, and limit query parameters.
    export async function handler(
      args: z.infer<typeof parameters>,
      extra: { client: PostmanAPIClient; headers?: IsomorphicHeaders; serverContext?: ServerContext }
    ): Promise<CallToolResult> {
      try {
        const endpoint = `/specs`;
        const query = new URLSearchParams();
        if (args.workspaceId !== undefined) query.set('workspaceId', String(args.workspaceId));
        if (args.cursor !== undefined) query.set('cursor', String(args.cursor));
        if (args.limit !== undefined) query.set('limit', String(args.limit));
        const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
        const options: any = {
          headers: extra.headers,
        };
        const result = await extra.client.get(url, options);
        return {
          content: [
            {
              type: 'text',
              text: `${typeof result === 'string' ? result : JSON.stringify(result, null, 2)}`,
            },
          ],
        };
      } catch (e: unknown) {
        if (e instanceof McpError) {
          throw e;
        }
        throw asMcpError(e);
      }
    }
  • Zod schema defining input parameters for getAllSpecs: workspaceId (required string), cursor (optional string for pagination), limit (optional integer, default 10).
    export const parameters = z.object({
      workspaceId: z.string().describe("The workspace's ID."),
      cursor: z
        .string()
        .describe(
          'The pointer to the first record of the set of paginated results. To view the next response, use the `nextCursor` value for this parameter.'
        )
        .optional(),
      limit: z
        .number()
        .int()
        .describe('The maximum number of rows to return in the response.')
        .default(10),
    });
  • Registration of 'getAllSpecs' in the 'full' resources list (line 100) and 'minimal' resources list (line 172), determining which tool preset includes it.
    'getAllSpecs',
  • src/index.ts:262-264 (registration)
    Dynamic tool registration loop that registers all loaded tools (including getAllSpecs) onto the McpServer using server.registerTool().
    // Register all tools using the McpServer registerTool method
    for (const tool of tools) {
      server.registerTool(
Behavior3/5

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

Annotations already declare `readOnlyHint=true`, `destructiveHint=false`, `idempotentHint=true`, so the tool's safety profile is clear. The description adds no further behavioral context (e.g., result size, pagination behavior beyond schema).

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 sentence with no extraneous information, earning its place efficiently.

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?

Given a simple read operation with pagination handled by the schema and annotations, the minimal description is largely sufficient. A slight improvement would be to mention pagination explicitly, but it's not a major gap.

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 fully documents parameters. The description does not add extra meaning beyond what the schema provides, warranting the baseline score of 3.

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 uses a specific verb ('Gets') and resource ('all API specifications in a workspace'), clearly distinguishing from siblings like `getSpec` (single spec) or `getSpecCollections`.

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 such as `getSpec` or `getSpecCollections`. The description lacks explicit context for selection.

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/postmanlabs/postman-mcp-server'

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