UNPKG

@postman/postman-mcp-server

Version:

Postman MCP Server — connect AI agents (Claude Code, Cursor, VS Code Copilot, Gemini CLI) to your Postman collections, specifications, and environments via Model Context Protocol (MCP)

32 lines (30 loc) • 1.65 kB
import { z } from 'zod'; import { asMcpError, McpError, defineToolAnnotations } from './utils/toolHelpers.js'; export const method = 'getInstalledApiMaintenanceInstructions'; export const title = 'Get installed API maintenance instructions'; export const description = `Returns instructions (markdown) for maintaining the API requests already installed in the user's project — listing installed requests, checking installed requests against their Postman sources for upstream changes, finding unused requests, and safely removing installed requests. Installed requests are identifiable by a "Generated by Postman Code" comment in the file header. Call this when the user wants to manage existing integrations (e.g., "what requests do we have installed?", "are my API integrations up to date?", "find unused Postman requests", "remove the Payvance requests"). Prerequisite: call getPostmanContextOverview first if you have not already loaded the Postman Context overview in this session.`; export const parameters = z.object({}); export const annotations = defineToolAnnotations({ title: 'Get installed API maintenance instructions', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }); export async function handler(_args, extra) { try { const result = await extra.client.get('/context/instructions/maintenance', { headers: extra.headers, }); return { content: [{ type: 'text', text: result }], }; } catch (e) { if (e instanceof McpError) { throw e; } throw asMcpError(e); } }