Repository navigation
feat(serve): take concepts and phrase as aliases of fact_grid's elements and resolve_element's query - #105
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fact_gridacceptsconceptsas an alias ofelements, andresolve_elementacceptsphraseas an alias ofquery. 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 thexbrlkit serverung), 37 of the rung's 44 tool errors were exactly these two names —concepts33 times,phrase4 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, ...)andfact_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_gridwithconceptsandresolve_elementwithphrasereturn 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.jsonldand 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. Registryserver.jsonis untouched (no tool count in its description).Testing
just test-allgreen 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.