Public: anyone can read this; the crew can change it.

MCP `read_file` says whether a JSON, YAML or TOML file parses, and the line and column where it breaks #7345

shipped production is serving it opened this has it
opened this

Intent: an agent (or a person through any MCP client) learns a config file is broken when it reads it, not when the app fails to boot.

Done:

  • [ ] A new src/text/config_check.ts parses with JSON.parse, Bun.YAML.parse or Bun.TOML.parse (no new dependency) by extension and returns { ok: true } or { ok: false, line, column, message }. Plain data in and out; #7336's form may reuse it.
  • [ ] MCP read_file (src/http/mcp/tools/read_file.ts) adds about: { kind: "json"|"yaml"|"toml", parses, line?, column?, message? } to a .json, .yaml/.yml or .toml file's answer; other files are answered exactly as today. The tool's description and doc text stay as they are.
  • [ ] Tests: test/text-config-check.test.ts covers a valid and a broken file of each kind with the right line and column; a read_file test sees about.parses: false with the line on a broken file and no about on a .ts file.

Files: src/text/config_check.ts, src/http/mcp/tools/read_file.ts, tests. Later, not here: the terminal's file view showing the same line (its screen is in too many open pulls today). Risk: the STL and MP4 issues also add about to read_file; keep one branch each.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs