Skip to main content
Glama

create_file

Create a new file with specified content and auto-generate parent directories. Use for writing new files or fully replacing existing ones.

Instructions

CREATE A NEW FILE with specified content. Primary tool for file creation - use whenever you need to create or completely replace a file's content. Automatically creates parent directories. Keywords: create, new file, write file, save file, make file. / 创建新文件并写入内容。这是文件创建的主要工具。自动创建父目录。关键词:创建、新建文件、写入文件、保存文件。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe file path to create. Can be absolute or relative to the current working directory. Supports nested paths - parent directories will be created automatically. Examples: 'src/main.go' (creates src/ directory if needed), '/tmp/test.txt' (absolute path), 'docs/api/readme.md' (creates docs/api/ directories).
contentYesThe content to write to the file. Can be any text content including source code, configuration files, JSON/YAML data, plain text, or documentation. The content will completely replace any existing file content.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYes
successYes
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 states that parent directories are created automatically and that content 'will completely replace any existing file content,' which discloses the destructive behavior. It does not cover permissions or error cases, but for a file creation tool these are the key behaviors.

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 front-loaded with the core purpose, then provides usage context, and includes keywords for search. It is slightly longer than necessary due to a redundant Chinese translation and keyword repetition, but each section serves a purpose and there is no wasted filler.

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

Completeness5/5

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

The tool is simple with only two parameters and a provided output schema. The description covers the purpose, when to use it, key behavioral traits (auto-create directories, overwrite), and parameter semantics via the schema. It is complete for an agent to select and invoke the tool correctly.

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 both path and content having detailed descriptions and examples. The tool description adds minimal extra meaning beyond the schema—it repeats that content replaces existing files and that parent directories are created, but these are already in the schema. Thus a baseline score of 3 is appropriate.

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 a specific verb and resource: 'CREATE A NEW FILE with specified content.' It also distinguishes itself as the 'Primary tool for file creation' and explicitly says 'use whenever you need to create or completely replace a file's content,' which differentiates it from siblings like write_file.

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

Usage Guidelines4/5

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

The description provides clear when-to-use guidance: 'use whenever you need to create or completely replace a file's content.' It also calls itself the 'Primary tool for file creation,' implying priority over siblings. However, it does not explicitly mention when not to use it or name alternatives like write_file, so it stops short of a perfect score.

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/shibingli/mcp-toolkit'

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