merge_environment_fork
Merge a forked environment back into its parent by specifying source and destination environment IDs. Optionally delete the source after merging.
Instructions
Merge a forked environment back into its parent
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environmentId | Yes | Environment ID in format: {ownerId}-{environmentId} | |
| source | Yes | Source environment ID in format: {ownerId}-{environmentId} | |
| destination | Yes | Destination environment ID in format: {ownerId}-{environmentId} | |
| strategy | No | Merge strategy options |
Implementation Reference
- The handler function that executes the merge_environment_fork tool logic. It POSTs to /environments/{environmentId}/merges with source, destination, and optional deleteSource strategy.
async mergeEnvironmentFork(args: any): Promise<ToolCallResponse> { const response = await this.client.post(`/environments/${args.environmentId}/merges`, { source: args.source, destination: args.destination, deleteSource: args.strategy?.deleteSource }); return this.createResponse(response.data); } - src/types/environment.ts:34-41 (schema)TypeScript interface MergeEnvironmentForkArgs defining the input type: environmentId, source, destination, and optional strategy with deleteSource.
export interface MergeEnvironmentForkArgs { environmentId: string; source: string; destination: string; strategy?: { deleteSource?: boolean; }; } - src/tools/api/environments/index.ts:47-48 (registration)Registration in the switch-case handler routing: case 'merge_environment_fork' dispatches to mergeEnvironmentFork(args).
case 'merge_environment_fork': return await this.mergeEnvironmentFork(args); - src/tools/api/environments/definitions.ts:148-176 (registration)Tool definition registration with name, description, and inputSchema listing environmentId, source, destination (required), and strategy (optional).
{ name: 'merge_environment_fork', description: 'Merge a forked environment back into its parent', inputSchema: { type: 'object', properties: { environmentId: { type: 'string', description: 'Environment ID in format: {ownerId}-{environmentId}' }, source: { type: 'string', description: 'Source environment ID in format: {ownerId}-{environmentId}' }, destination: { type: 'string', description: 'Destination environment ID in format: {ownerId}-{environmentId}' }, strategy: { type: 'object', description: 'Merge strategy options', properties: { deleteSource: { type: 'boolean', description: 'Whether to delete the source environment after merging' } } } }, required: ['environmentId', 'source', 'destination'] } },