Skip to main content
Glama

updateSpecProperties

Idempotent

Update an API specification's name by providing its ID and new name.

Instructions

Updates an API specification's properties, such as its name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specIdYesThe spec's ID.
nameYesThe spec's name.

Implementation Reference

  • Main handler function that PATCHes to /specs/{specId} with the provided name to update the API spec's properties. Uses PostmanAPIClient.patch().
    export async function handler(
      args: z.infer<typeof parameters>,
      extra: { client: PostmanAPIClient; headers?: IsomorphicHeaders; serverContext?: ServerContext }
    ): Promise<CallToolResult> {
      try {
        const endpoint = `/specs/${args.specId}`;
        const query = new URLSearchParams();
        const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
        const bodyPayload: any = {};
        if (args.name !== undefined) bodyPayload.name = args.name;
        const options: any = {
          body: JSON.stringify(bodyPayload),
          contentType: ContentType.Json,
          headers: extra.headers,
        };
        const result = await extra.client.patch(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: specId (required string) and name (required string).
    export const parameters = z.object({
      specId: z.string().describe("The spec's ID."),
      name: z.string().describe("The spec's name."),
    });
  • Tool name 'updateSpecProperties' listed in the 'full' and 'minimal' tool arrays in enabledResources.ts, which controls which tools are registered/enabled.
    const full = [
      // Collections
      'createCollection',
      'deleteCollection',
      'generateCollection',
      'getCollection',
      'getCollections',
      'patchCollection',
      'putCollection',
      'getCollectionTags',
      'updateCollectionTags',
      'getCollectionUpdatesTasks',
      'syncCollectionWithSpec',
      'syncSpecWithCollection',
      'generateSpecFromCollection',
      'getGeneratedCollectionSpecs',
      'getSpecCollections',
    
      // Collection Forks
      'getCollectionForks',
      'getSourceCollectionStatus',
      'getCollectionsForkedByUser',
      'pullCollectionChanges',
      'createCollectionFork',
      'mergeCollectionFork',
    
      // Collection Folders
      'createCollectionFolder',
      'deleteCollectionFolder',
      'getCollectionFolder',
      'updateCollectionFolder',
      'transferCollectionFolders',
    
      // Collection Requests
      'createCollectionRequest',
      'deleteCollectionRequest',
      'getCollectionRequest',
      'updateCollectionRequest',
      'transferCollectionRequests',
    
      // Collection Responses
      'createCollectionResponse',
      'deleteCollectionResponse',
      'getCollectionResponse',
      'updateCollectionResponse',
      'transferCollectionResponses',
    
      // Collection Runner
      'runCollection',
    
      // Comments
      'createCollectionComment',
      'deleteCollectionComment',
      'getCollectionComments',
      'updateCollectionComment',
      'updateApiCollectionComment',
      'createFolderComment',
      'deleteFolderComment',
      'getFolderComments',
      'updateFolderComment',
      'createRequestComment',
      'deleteRequestComment',
      'getRequestComments',
      'updateRequestComment',
      'createResponseComment',
      'deleteResponseComment',
      'getResponseComments',
      'updateResponseComment',
      'resolveCommentThread',
    
      // Environments
      'createEnvironment',
      'deleteEnvironment',
      'getEnvironment',
      'getEnvironments',
      'patchEnvironment',
      'putEnvironment',
    
      // Mocks
      'createMock',
      'deleteMock',
      'getMock',
      'getMocks',
      'updateMock',
      'publishMock',
      'unpublishMock',
    
      // Monitors
      'createMonitor',
      'deleteMonitor',
      'getMonitor',
      'getMonitors',
      'updateMonitor',
      'runMonitor',
    
      // Specs
      'createSpec',
      'deleteSpec',
      'getSpec',
      'getAllSpecs',
      'getSpecDefinition',
      'updateSpecProperties',
      'createSpecFile',
      'getSpecFile',
      'getSpecFiles',
      'updateSpecFile',
    
      // Workspaces
      'createWorkspace',
      'deleteWorkspace',
      'getWorkspace',
      'getWorkspaces',
      'updateWorkspace',
      'getWorkspaceGlobalVariables',
      'updateWorkspaceGlobalVariables',
      'getWorkspaceTags',
      'updateWorkspaceTags',
    
      // PAN (Private API Network)
      'listPrivateNetworkWorkspaces',
      'listPrivateNetworkAddRequests',
      'removeWorkspaceFromPrivateNetwork',
      'addWorkspaceToPrivateNetwork',
      'respondPrivateNetworkAddRequest',
    
      // // Documentation
      'publishDocumentation',
      'unpublishDocumentation',
    
      // Tasks and Status
      'getAsyncSpecTaskStatus',
      'getStatusOfAnAsyncApiTask',
    
      // User and Tags
      'getAuthenticatedUser',
      'getTaggedEntities',
    
      // Instructions
      'getCodeGenerationInstructions',
      'getPostmanContextOverview',
      'getApiDiscoveryInstructions',
      'getInstalledApiMaintenanceInstructions',
    
      // Transfer
      'transferCollectionFolders',
      'transferCollectionResponses',
      'transferCollectionResponses',
    
      // 'asyncMergePullCollectionFork' skipped
      // 'asyncMergePullCollectionTaskStatus' skipped
    
      // Duplicate Collection
      'duplicateCollection',
      'getDuplicateCollectionTaskStatus',
      'deleteApiCollectionComment',
      'deleteSpecFile',
      'getEnabledTools',
      'searchPostmanElements',
    
      // Analytics
      'getAnalyticsData',
      'getAnalyticsMetadata',
    
      // Context (AI-optimized markdown views)
      'getCollectionContext',
      'getFolderContext',
      'getRequestContext',
      'getResponseContext',
      'getRequestCodeContext',
      'getEnvironmentContext',
      'getWorkspacesContext',
      'getWorkspaceContext',
      'getWorkspaceEnvironmentsContext',
    ] as const;
  • Helper function used by the handler to convert unknown errors to McpError instances.
    export function asMcpError(error: unknown): McpError {
      const cause = (error as any)?.cause ?? String(error);
      return new McpError(ErrorCode.InternalError, cause);
    }
Behavior3/5

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

Annotations already declare idempotentHint true and destructiveHint false. The description adds no further behavioral details (e.g., success response, error conditions). Since annotations cover safety, a score of 3 is appropriate.

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 a single concise sentence, front-loaded with the key action. It is efficient but could include more usable information without being verbose.

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

Completeness3/5

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

For a simple tool with 2 required params and no output schema, the description is adequate but lacks explanation of return values or expected outcomes. Missing details on success/error behavior.

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 baseline is 3. The description mentions 'name' but adds no extra meaning beyond the schema's parameter descriptions. No elaboration on specId or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'updates' and resource 'API specification's properties', naming 'name' as an example. It distinguishes from siblings like createSpec (creation) and updateSpecFile (file content). However, the phrase 'such as its name' is slightly vague, implying possibly other properties not in the schema.

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 tool versus alternatives like updateSpecFile or updateCollection. The description provides no context for selection among many sibling tools.

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