Skip to main content
Glama

fs_write_file

Destructive

Write a file into your project by downloading it from an allowlisted OpenAI host using a file reference and lease ID. Moves uploaded or ImageGen-generated files from ChatGPT storage into your workspace.

Instructions

Write a binary file from a ChatGPT host file reference (openai/fileParams: download_url + file_id). Requires lease_id. Preferred way to move an uploaded or ImageGen-generated file into a project — pass the file itself, never Base64 of it. Downloads over HTTPS from an allowlisted OpenAI host only, including the code-interpreter sandbox storage that backs /mnt/data (no redirects; size capped at 2_000_000 bytes during stream). Same SHA/create/write gates as fs_write_binary. Portable clients should use fs_write_binary (Base64) instead. path is authoritative — file_name/mime_type are metadata only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesChatGPT openai/fileParams object (adaptation). Strings only — no nulls in schema.
pathYes
createNo
projectNodemo
lease_idYes
expected_sha256No

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description adds substantial behavioral constraints beyond annotations: HTTPS from an allowlisted OpenAI host, no redirects, a 2,000,000-byte size cap, and shared gates with fs_write_binary. It also clarifies that path is authoritative while file_name/mime_type are metadata only.

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?

The description is concise and front-loaded with the core purpose. Every sentence contributes critical constraints or usage guidance, with no fluff or redundancy.

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?

Despite the tool's complexity (external download, auth, size cap), the description covers essential behavioral aspects. The existence of an output schema covers return values, so the description doesn't need to. It is sufficient for an agent to invoke the tool correctly.

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

Parameters4/5

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

With only 17% schema coverage, the description compensates well by explaining the file object's key fields (download_url + file_id), the authoritative nature of path, and lease_id. It references create/SHA gates indirectly, though it doesn't fully explain the create and project parameters.

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 identifies the tool's verb ('Write') and resource ('binary file from a ChatGPT host file reference'). It explicitly differentiates from sibling fs_write_binary by noting it takes the file itself rather than Base64, making the purpose unambiguous.

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?

It gives explicit usage context: 'Preferred way to move an uploaded or ImageGen-generated file into a project' and states the alternative ('Portable clients should use fs_write_binary (Base64) instead'). Also highlights the requirement for lease_id.

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/davidlosasgonzalez/codeagent-mcp'

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