Skip to main content
Glama

MCP File Editor Server

by pwilkin

insert_into_file

Insert content into a file at a specified line position using the MCP File Editor Server. Choose to insert before or after a target line, or append to the end, with content verification for precise file modifications.

Instructions

Insert content into a file at a specific line position.

Input Schema

NameRequiredDescriptionDefault
contentsYesContent to insert
file_pathYesAbsolute path to the file
line_contentsYesExpected content of the target line (used for verification)
line_numberYesLine number to insert at (1-based). Use 0 to append to end.
whereYesWhether to insert before or after the target line

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "contents": { "description": "Content to insert", "type": "string" }, "file_path": { "description": "Absolute path to the file", "type": "string" }, "line_contents": { "description": "Expected content of the target line (used for verification)", "type": "string" }, "line_number": { "description": "Line number to insert at (1-based). Use 0 to append to end.", "minimum": 0, "type": "integer" }, "where": { "description": "Whether to insert before or after the target line", "enum": [ "before", "after" ], "type": "string" } }, "required": [ "file_path", "line_number", "line_contents", "where", "contents" ], "type": "object" }

Other Tools from MCP File Editor Server

Related Tools

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/pwilkin/mcp-file-edit'

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