write_file

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package write_file implements the write_file MCP tool handler.

The tool accepts a logical name, a relative file path, and file content. It resolves the node's frontmatter from the logical name, validates the target path against the node's implements list and the project root, then writes the file to disk.

Spec ref: ROOT/tech_design/internal/tools/write_file § "Intent"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(server *mcp.Server)

Register adds the write_file tool to the given MCP server.

Tool name and description follow the spec exactly. Spec ref: ROOT/tech_design/internal/tools/write_file § "Tool definition"

Types

type WriteFileArgs

type WriteFileArgs struct {
	LogicalName string `json:"logical_name" jsonschema:"Logical name of the node whose implements list authorizes the write."`
	Path        string `json:"path"         jsonschema:"Relative file path from project root."`
	Content     string `json:"content"      jsonschema:"Complete file content to write."`
}

WriteFileArgs holds the input parameters for the write_file tool.

Spec ref: ROOT/tech_design/internal/tools/write_file § "WriteFileArgs type"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL