get_environment
Retrieve configuration details of a Postman environment using its unique identifier. Returns environment variables and metadata.
Instructions
Get details of a specific environment
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environmentId | Yes | Environment ID in format: {ownerId}-{environmentId} (e.g., "31912785-b8cdb26a-0c58-4f35-9775-4945c39d7ee2") |
Implementation Reference
- The getEnvironment handler method that executes the tool logic. Makes a GET request to /environments/{environmentId} and returns the response.
async getEnvironment(environmentId: string): Promise<ToolCallResponse> { const response = await this.client.get(`/environments/${environmentId}`); return this.createResponse(response.data); } - src/tools/api/environments/index.ts:30-58 (registration)The handleToolCall dispatcher that routes the 'get_environment' tool name to the getEnvironment method.
async handleToolCall(name: string, args: any): Promise<ToolCallResponse> { try { switch (name) { case 'list_environments': return await this.listEnvironments(args.workspace); case 'get_environment': return await this.getEnvironment(args.environmentId); case 'create_environment': return await this.createEnvironment(args); case 'update_environment': return await this.updateEnvironment(args); case 'delete_environment': return await this.deleteEnvironment(args.environmentId); case 'fork_environment': return await this.createEnvironmentFork(args); case 'get_environment_forks': return await this.getEnvironmentForks(args); case 'merge_environment_fork': return await this.mergeEnvironmentFork(args); case 'pull_environment': return await this.pullEnvironment(args); default: throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`); } } catch (error: any) { // Let base class interceptor handle API errors throw error; } } - The input schema definition for 'get_environment' specifying the environmentId parameter.
{ name: 'get_environment', description: 'Get details of a specific environment', inputSchema: { type: 'object', properties: { environmentId: { type: 'string', description: 'Environment ID in format: {ownerId}-{environmentId} (e.g., "31912785-b8cdb26a-0c58-4f35-9775-4945c39d7ee2")', }, }, required: ['environmentId'], }, }, - src/types/environment.ts:26-32 (helper)Type definition for GetEnvironmentForksArgs - not directly used by get_environment but relevant to the environments tool family.
export interface GetEnvironmentForksArgs { environmentId: string; cursor?: string; direction?: 'asc' | 'desc'; limit?: number; sort?: 'createdAt'; }