updateSpecProperties
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
| Name | Required | Description | Default |
|---|---|---|---|
| specId | Yes | The spec's ID. | |
| name | Yes | The spec's name. |
Implementation Reference
- src/tools/updateSpecProperties.ts:19-49 (handler)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."), }); - src/enabledResources.ts:1-174 (registration)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; - src/tools/utils/toolHelpers.ts:10-13 (helper)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); }