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
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
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:
src/text/config_check.tsparses withJSON.parse,Bun.YAML.parseorBun.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.read_file(src/http/mcp/tools/read_file.ts) addsabout: { kind: "json"|"yaml"|"toml", parses, line?, column?, message? }to a.json,.yaml/.ymlor.tomlfile's answer; other files are answered exactly as today. The tool's description and doc text stay as they are.test/text-config-check.test.tscovers a valid and a broken file of each kind with the right line and column; a read_file test seesabout.parses: falsewith the line on a broken file and noabouton a.tsfile.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 addaboutto read_file; keep one branch each.