Skip to content

feat(serve): take concepts and phrase as aliases of fact_grid's elements and resolve_element's query - #105

Merged
jfrench9 merged 1 commit into
mainfrom
feature/fact-grid-argument-aliases
Nov 9, 2026
Merged

jfrench9 merged 1 commit into
mainfrom
feature/fact-grid-argument-aliases

Conversation

@jfrench9

@jfrench9 jfrench9 commented Nov 9, 2026

Copy link
Copy Markdown
Member

Summary

fact_grid accepts concepts as an alias of elements, and resolve_element accepts phrase as an alias of query. Both tool descriptions already speak of "concepts" and "a phrase"; the arguments did not, and models name the argument after the description's noun. In the Filing Ladder's v0.2 run (Sonnet 5.5, 114 records on the xbrlkit serve rung), 37 of the rung's 44 tool errors were exactly these two names — concepts 33 times, phrase 4 times — each refused by the schema and retried a turn later. The tools now take what was sent.

Changes

  • serve/server.py (surface): resolve_element(query, phrase, ...) and fact_grid(elements, concepts, ...). Each original argument becomes optional in the schema and the alias is added beside it with a one-line description; the wrapper merges the two (the original first, the alias's extra names after it, duplicates dropped) before calling the unchanged tool function. A call that names neither still returns the tool's own "is required" error.
  • tests/test_serve.py: a server-level test through the in-memory MCP client — fact_grid with concepts and resolve_element with phrase return byte-identical results to the original names; both aliases are listed in the tool schemas; a call naming neither returns the error.

Output Impact

INTERNAL for holon.jsonld and the TAVI projection — nothing emitted changes. The MCP surface gains two optional arguments; no existing call changes meaning and no argument is removed, so every client that worked keeps working. Registry server.json is untouched (no tool count in its description).

Testing

just test-all green on the fixture filing the serve tests build in memory (tests/test_serve.py, _model()); no EDGAR filing was converted — the change is to argument handling at the MCP boundary and does not touch parsing or serialization.

…nts and resolve_element's query

The two tool descriptions speak of "concepts" and "a phrase"; the arguments were
named elements and query, and a model names the argument after the description's
noun. In the Filing Ladder's v0.2 run, 37 of the serve rung's 44 tool errors were
these two names, each refused by the schema and retried a turn later. Both tools
now take either name; a call that names the original is unchanged.

Claude-Session: https://claude.ai/code/session_01AGZDQcxaocZb3djRwdRK87
@jfrench9
jfrench9 merged commit a01ba6f into main Nov 9, 2026
6 checks passed
@jfrench9
jfrench9 deleted the feature/fact-grid-argument-aliases branch November 9, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant