Skip to main content
Glama
ckanthony

Chisel

write_file

Create or overwrite files with automatic parent directory creation. Returns an error in read-only mode to prevent unintended modifications.

Instructions

Write content to a file (create or overwrite). Creates parent dirs. Returns error in read-only mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
pathYes

Implementation Reference

  • The chisel_write_file function is the handler that delegates to chisel's 'write_file' tool via a client session. It takes a path and content, and calls _chisel_call('write_file', ...) which opens a streaming HTTP session to the chisel MCP server and invokes the 'write_file' tool.
    async def chisel_write_file(path: str, content: str) -> str:
        return await _chisel_call("write_file", path=path, content=content)
  • The _chisel_call helper function opens a streamable HTTP client session to the chisel server, initializes it, and calls the specified tool with keyword arguments. It is used by chisel_write_file to delegate to the remote 'write_file' tool.
    async def _chisel_call(tool: str, **kwargs) -> str:
        """Open a session to chisel, call one tool, return the text result."""
        async with streamablehttp_client(CHISEL_URL, headers=_HEADERS) as (read, write, _):
            async with ClientSession(read, write) as session:
                await session.initialize()
                result = await session.call_tool(tool, kwargs)
                return result.content[0].text
  • The 'scaffold_module' tool is registered via @mcp.tool() decorator and internally calls chisel_write_file to create a file. While write_file itself isn't directly registered as an MCP tool in this server, it's called as a dependency of registered tools.
    @mcp.tool()
    async def scaffold_module(name: str, directory: str) -> str:
        """
        Scaffold a new Python module with a class stub.
    
        Args:
            name:      snake_case module name, e.g. user_service
            directory: Path relative to the project root, e.g. src/services
        """
        path    = f"{CHISEL_ROOT}/{directory}/{name}.py"
        class_name = "".join(word.title() for word in name.split("_"))
        content = textwrap.dedent(f"""\
            from dataclasses import dataclass
    
    
            @dataclass
            class {class_name}:
                \"\"\"TODO: document {class_name}.\"\"\"
    
                def run(self) -> None:
                    raise NotImplementedError
        """)
    
        result = await chisel_write_file(path, content)
        return f"Created {path}\n{result}"
Behavior4/5

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

Despite no annotations, the description discloses key behaviors: creates parent directories, returns error in read-only mode. This adds valuable context beyond the basic write operation.

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?

Extremely concise: three sentences, no fluff. First sentence front-loads the purpose. Every sentence adds meaningful information.

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?

For a simple tool with two params and no output schema, the description covers the main behavior, directory creation, and error condition. Minor missing details like path format or content encoding, but adequate overall.

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

Parameters2/5

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

The description provides no information about the parameters beyond what the schema shows (path and content). With 0% schema coverage, the description should clarify format or constraints but fails to do so.

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 writes content to a file, with create or overwrite semantics. It distinguishes from sibling tools like append (which appends) and create_directory (which creates directories).

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?

No explicit guidance on when to use this tool versus alternatives like append or create_directory. The description only mentions behavior but not context of use.

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/ckanthony/chisel'

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