Skip to main content
Glama

interactive_edit_session

Destructive

Start an interactive editing session to perform complex file modifications using step-by-step instructions for precise control over changes.

Instructions

Start an interactive editing session for complex edits

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYesList of files to edit
instructionsNoInstructions for the editing session

Implementation Reference

  • src/index.ts:306-329 (registration)
    Registration of the interactive_edit_session tool, including input schema, description, and annotations.
    mcpServer.registerTool({
      name: 'interactive_edit_session',
      description: 'Start an interactive editing session for complex edits',
      inputSchema: {
        type: 'object',
        properties: {
          files: {
            type: 'array',
            description: 'List of files to edit'
          },
          instructions: {
            type: 'string',
            description: 'Instructions for the editing session'
          }
        },
        required: ['files']
      },
      annotations: {
        readOnlyHint: false,
        destructiveHint: true,
        idempotentHint: false,
        openWorldHint: false
      }
    });
  • Input schema definition for the interactive_edit_session tool.
    inputSchema: {
      type: 'object',
      properties: {
        files: {
          type: 'array',
          description: 'List of files to edit'
        },
        instructions: {
          type: 'string',
          description: 'Instructions for the editing session'
        }
      },
      required: ['files']
  • Handler logic in executeWithEdit: creates edit session for the files and returns sessionId without closing it.
    const sessionId = await this.editInstanceManager.createEditSession(operation.affectedFiles);
    
    try {
      switch (operation.type) {
        case 'interactive_edit_session':
          // Return the session ID for the client to use
          return { sessionId };
  • Core helper function createEditSession that spawns an EditInstance process, opens the specified files, and returns the session ID for interactive use.
    public async createEditSession(files: string[]): Promise<string> {
      const sessionId = uuidv4();
      const instance = await this.createInstance(sessionId);
    
      // Open all files
      for (const file of files) {
        await instance.openFile(file);
      }
    
      return sessionId;
    }
  • Ensures the session remains open for interactive_edit_session by skipping closeEditSession.
    if (operation.type !== 'interactive_edit_session') {
      await this.editInstanceManager.closeEditSession(sessionId).catch(console.error);
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate destructiveHint=true, readOnlyHint=false, openWorldHint=false, and idempotentHint=false, covering safety and idempotency. The description adds value by specifying 'interactive' and 'complex edits,' suggesting a non-automated, involved process, though it doesn't detail session mechanics or side effects. No contradiction with annotations exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('Start an interactive editing session') and qualifies it ('for complex edits'). There's no wasted text, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the destructive nature (annotations show destructiveHint=true), lack of output schema, and complexity implied by 'interactive' and 'complex edits,' the description is minimally adequate. It covers the purpose but lacks details on session behavior, outcomes, or error handling, which could help the agent use it effectively in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for 'files' and 'instructions.' The description doesn't add meaning beyond the schema, such as explaining file formats or instruction specifics, but it doesn't need to since the schema is comprehensive. Baseline 3 is appropriate as the schema carries the burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('Start an interactive editing session') and the scope ('for complex edits'), which provides a basic purpose. However, it doesn't specify what 'interactive' entails or how it differs from sibling tools like 'write_file' or 'smart_refactor', making it somewhat vague rather than clearly distinguishing from alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for 'complex edits' but offers no explicit guidance on when to use this tool versus alternatives such as 'write_file' for simple writes or 'smart_refactor' for automated refactoring. There's no mention of prerequisites, exclusions, or specific contexts, leaving the agent with minimal direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mixelpixx/microsoft-edit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server