Skip to main content
Glama
lin2000wl

Serena MCP Server

by lin2000wl

create_text_file

Create or overwrite text files by writing complete content to specified paths. Use for new files or full file replacements in codebases.

Instructions

Write a new file (or overwrite an existing file). For existing files, it is strongly recommended to use symbolic operations like replace_symbol_body or insert_after_symbol/insert_before_symbol, if possible. You can also use insert_at_line to insert content at a specific line for existing files if the symbolic operations are not the right choice for what you want to do.

If ever used on an existing file, the content has to be the complete content of that file (so it may never end with something like "The remaining content of the file is left unchanged."). For operations that just replace a part of a file, use the replace_lines or the symbolic editing tools instead. Returns a message indicating success or failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relative_pathYesThe relative path to the file to create.
contentYesThe (utf-8-encoded) content to write to the file.
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively communicates that this is a destructive write operation (overwrites existing files completely), specifies constraints (content must be complete, no partial changes), and mentions the return value (success/failure message). It doesn't cover permissions, rate limits, or error details, but provides solid operational context.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded with the core purpose. Every sentence earns its place by providing essential guidance about alternatives, constraints, and return values. It could be slightly more concise by combining some of the alternative tool recommendations, but overall it's well-structured and efficient.

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

Completeness4/5

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

Given this is a destructive write operation with no annotations and no output schema, the description does an excellent job of providing necessary context. It explains the tool's behavior, constraints, alternatives, and return value. The main gap is the lack of detail about specific error conditions or permission requirements, but for a file creation tool with good sibling differentiation, it's quite complete.

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%, so the schema already documents both parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema (relative_path and content). However, it does provide important context about how the content parameter must represent complete file content, which adds semantic value beyond the schema's basic description.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('write', 'overwrite') and resource ('file'), distinguishing it from sibling tools like replace_lines, insert_at_line, and symbolic editing tools. It explicitly defines the scope as creating new files or completely overwriting existing ones.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool versus alternatives. It specifies that for existing files, symbolic operations (replace_symbol_body, insert_after_symbol, insert_before_symbol) or insert_at_line are recommended instead, and for partial replacements, replace_lines or symbolic editing tools should be used. This clearly differentiates it from all relevant sibling tools.

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/lin2000wl/Serena-cursor-mcp'

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