Execute File Processing
ctx_execute_fileProcess files by running custom code in a sandbox. Only the printed summary enters context, preserving LLM capacity for analysis.
Instructions
Read a file and process it without loading contents into context. The file is read into a FILE_CONTENT variable inside the sandbox. Only your printed summary enters context.
PREFER THIS OVER Read/cat for: log files, data files (CSV, JSON, XML), large source files for analysis, and any file where you need to extract specific information rather than read the entire content.
THINK IN CODE: Write code that processes FILE_CONTENT and console.log() only the answer. Don't read files into context to analyze mentally. Write robust, pure JavaScript — no npm deps, try/catch, null-safe. Node.js + Bun compatible.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute file path or relative to project root | |
| language | Yes | Runtime language | |
| code | Yes | Code to process FILE_CONTENT (file_content in Elixir). Print summary via console.log/print/echo/IO.puts/Console.WriteLine. | |
| timeout | No | Max execution time in ms. When omitted, no server-side timer fires — the MCP host's RPC timeout governs. | |
| intent | No | What you're looking for in the output. When provided and output is large (>5KB), returns only matching sections via BM25 search instead of truncated output. |