get_schema_file_contents
Retrieve the contents of a schema file by providing API ID, schema ID, and file path, with optional version ID for API viewers.
Instructions
Get contents of a schema file
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiId | Yes | API ID | |
| schemaId | Yes | Schema ID | |
| filePath | Yes | Path to the schema file | |
| versionId | No | Version ID (required for API viewers) |
Implementation Reference
- src/tools/api/apis/index.ts:375-385 (handler)Handler function that calls Postman API to get schema file contents, accepting apiId, schemaId, filePath, and optional versionId.
async getSchemaFileContents(args: any): Promise<ToolCallResponse> { if (!args.apiId || !args.schemaId || !args.filePath) { throw new McpError(ErrorCode.InvalidParams, 'apiId, schemaId, and filePath are required'); } const { apiId, schemaId, filePath, versionId } = args; const response = await this.client.get( `/apis/${apiId}/schemas/${schemaId}/files/${filePath}`, { params: { versionId } } ); return this.createResponse(response.data); } - Schema definition for the get_schema_file_contents tool, specifying input parameters and required fields.
{ name: 'get_schema_file_contents', description: 'Get contents of a schema file', inputSchema: { type: 'object', properties: { apiId: { type: 'string', description: 'API ID', }, schemaId: { type: 'string', description: 'Schema ID', }, filePath: { type: 'string', description: 'Path to the schema file', }, versionId: { type: 'string', description: 'Version ID (required for API viewers)', }, }, required: ['apiId', 'schemaId', 'filePath'], }, }, - src/tools/api/apis/index.ts:81-82 (registration)Registration of the tool name in the handleToolCall switch statement, routing to the handler method.
case 'get_schema_file_contents': return await this.getSchemaFileContents(args);