Skip to main content
Glama

getTaggedEntities

Read-onlyIdempotent

Retrieve tagged Postman entities such as APIs, collections, or workspaces by providing a tag slug. Filter results by entity type and paginate through responses.

Instructions

Requires an Enterprise plan. Tagging is only available on Postman Enterprise plans. This tool returns a 404 error on Free, Basic, and Professional accounts.

Gets Postman elements (entities) by a given tag. Tags enable you to organize and search workspaces, APIs, and collections that contain shared tags.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesThe tag's ID within a team or individual (non-team) user scope.
limitNoThe maximum number of tagged elements to return in a single call.
directionNoThe ascending (`asc`) or descending (`desc`) order to sort the results by, based on the time of the entity's tagging.desc
cursorNoThe cursor to get the next set of results in the paginated response. If you pass an invalid value, the API only returns the first set of results.
entityTypeNoFilter results for the given entity type.

Implementation Reference

  • The handler function that executes the 'getTaggedEntities' tool logic. It makes a GET request to /tags/{slug}/entities with optional query parameters (limit, direction, cursor, entityType) and returns the result.
    export async function handler(
      args: z.infer<typeof parameters>,
      extra: { client: PostmanAPIClient; headers?: IsomorphicHeaders; serverContext?: ServerContext }
    ): Promise<CallToolResult> {
      try {
        const endpoint = `/tags/${args.slug}/entities`;
        const query = new URLSearchParams();
        if (args.limit !== undefined) query.set('limit', String(args.limit));
        if (args.direction !== undefined) query.set('direction', String(args.direction));
        if (args.cursor !== undefined) query.set('cursor', String(args.cursor));
        if (args.entityType !== undefined) query.set('entityType', String(args.entityType));
        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 parameters for getTaggedEntities: slug (string, regex validated), limit (number, max 50), direction (asc/desc), cursor (optional string), entityType (optional enum: api/collection/workspace).
    export const parameters = z.object({
      slug: z
        .string()
        .regex(new RegExp('^[a-z][a-z0-9-]*[a-z0-9]+$'))
        .min(2)
        .max(64)
        .describe("The tag's ID within a team or individual (non-team) user scope."),
      limit: z
        .number()
        .int()
        .lte(50)
        .describe('The maximum number of tagged elements to return in a single call.')
        .default(10),
      direction: z
        .enum(['asc', 'desc'])
        .describe(
          "The ascending (`asc`) or descending (`desc`) order to sort the results by, based on the time of the entity's tagging."
        )
        .default('desc'),
      cursor: z
        .string()
        .describe(
          'The cursor to get the next set of results in the paginated response. If you pass an invalid value, the API only returns the first set of results.'
        )
        .optional(),
      entityType: z
        .enum(['api', 'collection', 'workspace'])
        .describe('Filter results for the given entity type.')
        .optional(),
    });
  • Annotations for the tool: title, readOnlyHint (true), destructiveHint (false), idempotentHint (true).
    export const annotations = {
      title:
        '**Requires an Enterprise plan.** Tagging is only available on Postman Enterprise plans. This tool returns a 404 error on Free, Basic, and Professional accounts.',
      readOnlyHint: true,
      destructiveHint: false,
      idempotentHint: true,
    };
  • getTaggedEntities is registered in the 'full' enabled resources list (line 136) and also in the 'minimal' list (line 199).
    'getTaggedEntities',
  • The asMcpError helper utility used by the handler to wrap errors into McpError format.
    export function asMcpError(error: unknown): McpError {
      const cause = (error as any)?.cause ?? String(error);
      return new McpError(ErrorCode.InternalError, cause);
    }
Behavior4/5

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

Annotations already indicate readOnly, non-destructive, idempotent behavior. The description adds valuable context about plan restriction and error conditions, plus cursor behavior (invalid cursor returns first set), which goes 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?

The description is concise with two focused paragraphs. The first paragraph highlights the critical plan restriction, and the second explains the core functionality. No extraneous content, though it could be more structured (e.g., bullet points).

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 no output schema, the description adequately explains the tool's input and purpose. It covers the plan requirement, error conditions, and basic function. Missing explicit mention of return format or pagination, but schema covers cursor details, leaving only minor gaps.

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?

Input schema covers all 5 parameters with 100% description coverage. The tool description does not add new parameter information beyond the schema's detailed descriptions, meeting the baseline 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 tool's purpose: 'Gets Postman elements (entities) by a given tag.' It distinguishes itself from sibling tools as the only one retrieving entities by tag, with no ambiguity.

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

Usage Guidelines4/5

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

The description explicitly notes the Enterprise plan requirement and the 404 error on other plans, which is critical usage guidance. It lacks explicit comparison to alternatives, but since no sibling tool offers similar functionality, the guidance is sufficient.

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