Problem
The document model serializes filename and slug on every row the read tools return, without omitempty. Both are derivable from path, which is already present. The list_documents description does not mention them, so only the wire payload carries the redundancy.
The struct moved in v0.7.0: it is docs.Document in internal/docs/document.go (aliased as LocalDocument in internal/mcp/tools/docs_bridge.go), not internal/mcp/tools/common.go.
Internal consumers — already checked
Both fields are read inside the binary, so they cannot be deleted outright:
Slug — internal/advisory/code_alignment.go, which turns a slug into search tokens
Filename — cmd/status.go, in the naming check
The change is therefore json:"-" on both fields, keeping the Go fields in place.
Expected result
Read-tool JSON payloads omit filename and slug. The Go struct keeps them for internal use.
Impact
~430 tokens per 50 documents on list_documents and search_documents — among the most frequently called tools. Item 2 in .archcore/cli/mcp-token-optimization.idea.md.
Scope
Files: internal/docs/document.go (+ list/search/get tests)
Acceptance: read-tool payloads omit filename and slug, and the integration suite passes.
Problem
The document model serializes
filenameandslugon every row the read tools return, withoutomitempty. Both are derivable frompath, which is already present. Thelist_documentsdescription does not mention them, so only the wire payload carries the redundancy.The struct moved in v0.7.0: it is
docs.Documentininternal/docs/document.go(aliased asLocalDocumentininternal/mcp/tools/docs_bridge.go), notinternal/mcp/tools/common.go.Internal consumers — already checked
Both fields are read inside the binary, so they cannot be deleted outright:
Slug—internal/advisory/code_alignment.go, which turns a slug into search tokensFilename—cmd/status.go, in the naming checkThe change is therefore
json:"-"on both fields, keeping the Go fields in place.Expected result
Read-tool JSON payloads omit
filenameandslug. The Go struct keeps them for internal use.Impact
~430 tokens per 50 documents on
list_documentsandsearch_documents— among the most frequently called tools. Item 2 in.archcore/cli/mcp-token-optimization.idea.md.Scope
json:"-"ininternal/docs/document.go.search_documentsandget_documentfor their own copies of the fields in response structs.examples/fixtures if they pin the payload.Files:
internal/docs/document.go(+ list/search/get tests)Acceptance: read-tool payloads omit
filenameandslug, and the integration suite passes.