Skip to main content
Glama

getMock

Read-onlyIdempotent

Gets information about a mock server: collection UID and mock URL, for navigating to the source collection.

Instructions

Gets information about a mock server.

  • Resource: Mock server entity. Response includes the associated `collection` UID and `mockUrl`.

  • Use the `collection` UID to navigate back to the source collection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mockIdYesThe mock's ID.

Implementation Reference

  • The main handler function that executes the 'getMock' tool logic. It makes a GET request to /mocks/{mockId} using the Postman API client and returns the result as JSON text.
    export async function handler(
      args: z.infer<typeof parameters>,
      extra: { client: PostmanAPIClient; headers?: IsomorphicHeaders; serverContext?: ServerContext }
    ): Promise<CallToolResult> {
      try {
        const endpoint = `/mocks/${args.mockId}`;
        const query = new URLSearchParams();
        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 the input parameter: mockId (string).
    export const parameters = z.object({ mockId: z.string().describe("The mock's ID.") });
  • Registration of 'getMock' in the 'full' enabled resources list.
    'getMock',
    'getMocks',
  • Registration of 'getMock' in the 'minimal' enabled resources list.
    'getMock',
    'getMocks',
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint, idempotentHint. Description adds specific response contents (collection UID, mockUrl) and suggests a follow-up action (navigate to source collection). Adds value beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Concise at three lines, but uses bullet-like formatting that could be streamlined. No wasted sentences; front-loaded with main action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple get operation with one parameter and complete annotations, description provides sufficient context about response and follow-up. No output schema needed.

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% with one parameter 'mockId' described as 'The mock's ID.' Description does not add further meaning to the parameter, so baseline 3 is appropriate.

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?

Clearly states it gets info about a mock server, specifies response includes collection UID and mockUrl. Distinguishes from siblings like getMocks (plural) and createMock (write).

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 on when to use this vs alternatives like getMocks. Only implicit from singular vs plural. No when-nots or exclusions.

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