Priority
P1/P2 agent-contract issue: exact inspection publishes a schema that is sufficient for validation but intentionally removes much of the information an agent or host needs to construct the first valid call.
Area
math.find CONTRACT/FULL views, JSON Schema projection, selected capability execution, invocation examples, nested/union request construction.
Summary
Jacobian’s exact CONTRACT view is described as validation-equivalent. To keep it compact, _compact_json_schema() recursively removes annotation and routing fields including:
title
description
examples
default
discriminator
readOnly
writeOnly
The remaining constraints can reject an invalid payload, but they may not explain:
- what a nested field means mathematically;
- which
oneOf/union branch corresponds to the intended representation;
- whether omission is semantically equivalent to a documented default;
- the coordinate/order/canonicalization convention expected by a field;
- how sibling objects such as
input and candidate relate;
- which value is an identifier, expression, artifact reference, or literal mathematical object.
This optimizes for a validator rather than for the model/host that must generate a valid request. Recent PRs repeatedly compensate by adding descriptor prose or one top-level invocation example for a specific failure. Those fixes are valuable, but the underlying schema projection remains semantically thin.
Audit baseline: current main, particularly:
src/jacobian/adapters/mcp/projections.py
src/jacobian/adapters/mcp/tools.py
src/jacobian/contracts/capabilities.py
docs/reference/tools.md
Current behavior
CONTRACT projection strips construction annotations
def _compact_json_schema(schema):
dropped_annotations = {
"title",
"description",
"examples",
"default",
"discriminator",
"readOnly",
"writeOnly",
}
...
math.find(capability_id=..., view="CONTRACT") exposes this compact schema and validates examples against the full underlying schema.
FULL is not an ergonomic construction fallback
FULL adds the complete output schema, provider configuration, licenses, features, and audit metadata. An agent that needs one missing field description should not have to load the largest audit projection. Issue #932 already records that complete FULL descriptors can exceed arbitrary inline byte limits.
Whole-payload examples cannot explain every branch
Descriptor-owned invocation examples are helpful but optional and bounded. Discovery returns at most one example per card. A single payload cannot explain every valid representation, optional field, nested object, or discriminated branch.
PR #929 and issue #941 show the common input/candidate nesting failure. PR #925 adds sparse-polynomial canonicalization prose and a specific example after repeated malformed calls. These are symptoms of a construction contract that exists outside the schema the host actually sees.
Standards context
JSON Schema explicitly separates validation keywords from annotation keywords. description, default, and examples do not change acceptance, but they are intended to make schemas self-documenting and usable by documentation, form, and generation tooling:
https://json-schema.org/understanding-json-schema/reference/annotations
MCP tool definitions use JSON Schema not only for server validation but also to guide clients and language models in constructing and understanding tool inputs:
https://modelcontextprotocol.io/specification/2025-11-25/server/tools
“Validation-equivalent” is therefore necessary but not sufficient for an agent-facing tool contract.
Root cause
The architecture treats one projection as though it can serve three different consumers:
- server-side validation;
- host-side call generation/autocomplete;
- compact model context.
Those consumers need the same constraints but different presentation. Removing every annotation minimizes bytes, while FULL maximizes audit completeness. There is no bounded middle representation optimized for call construction.
Proposed architecture
1. Distinguish canonical, validation, and generation projections
Keep one authoritative domain-owned schema contract, then expose explicit projections such as:
canonical_schema complete contract identity and annotations
validation_schema exact constraints used by the validator
construction_schema bounded constraints + agent/host-relevant annotations
Names may differ. The projections must be derived from one source rather than maintained independently.
2. Preserve bounded semantic annotations in CONTRACT
CONTRACT should retain or separately project:
- concise field descriptions;
- validated defaults and examples;
- union/discriminator routing metadata;
- deprecation/read-only/write-only facts where relevant;
- coordinate/order/domain/canonicalization notes that affect correct construction;
- exact JSON pointers linking annotations to fields.
Apply explicit per-description, per-example, branch, and total byte limits. An omitted annotation needs a deterministic recovery path to the canonical schema resource rather than silent deletion.
3. Treat discriminators as generation-critical
Even where a JSON Schema discriminator is not required for validation semantics, it tells a host/model which property selects a branch. Preserve it in the construction schema and test oneOf/anyOf requests through supported clients.
4. Validate annotations at registration
- examples must validate against the owning branch/schema;
- defaults must validate and must not imply server-side filling unless the runtime actually applies that semantic default;
- descriptions must be bounded and non-contradictory with required/enum/range constraints;
- field annotations should be domain-owned, not inferred from names by the MCP adapter.
5. Feed schema-bound execution
The selected execution path in #1031 should give the host the construction-oriented schema, while authoritative runtime validation continues to use the canonical validation contract. Host-side generation remains an ergonomic layer, not a security boundary.
6. Provide canonical resources for large contracts
If the complete annotated schema is too large inline, return a compact typed construction projection plus a native ResourceLink/URI to the exact canonical schema. Do not force the agent to choose FULL merely to recover one field description.
Acceptance criteria
Related work
Non-goals
- Weakening or replacing runtime validation.
- Returning every provider/audit field in the construction projection.
- Treating examples or descriptions as mathematical evidence.
- Having the MCP adapter guess domain semantics from property names.
- Filling JSON Schema
default values unless the capability’s runtime contract explicitly defines that behavior.
Priority
P1/P2 agent-contract issue: exact inspection publishes a schema that is sufficient for validation but intentionally removes much of the information an agent or host needs to construct the first valid call.
Area
math.findCONTRACT/FULL views, JSON Schema projection, selected capability execution, invocation examples, nested/union request construction.Summary
Jacobian’s exact CONTRACT view is described as validation-equivalent. To keep it compact,
_compact_json_schema()recursively removes annotation and routing fields including:The remaining constraints can reject an invalid payload, but they may not explain:
oneOf/union branch corresponds to the intended representation;inputandcandidaterelate;This optimizes for a validator rather than for the model/host that must generate a valid request. Recent PRs repeatedly compensate by adding descriptor prose or one top-level invocation example for a specific failure. Those fixes are valuable, but the underlying schema projection remains semantically thin.
Audit baseline: current
main, particularly:src/jacobian/adapters/mcp/projections.pysrc/jacobian/adapters/mcp/tools.pysrc/jacobian/contracts/capabilities.pydocs/reference/tools.mdCurrent behavior
CONTRACT projection strips construction annotations
math.find(capability_id=..., view="CONTRACT")exposes this compact schema and validates examples against the full underlying schema.FULL is not an ergonomic construction fallback
FULL adds the complete output schema, provider configuration, licenses, features, and audit metadata. An agent that needs one missing field description should not have to load the largest audit projection. Issue #932 already records that complete FULL descriptors can exceed arbitrary inline byte limits.
Whole-payload examples cannot explain every branch
Descriptor-owned invocation examples are helpful but optional and bounded. Discovery returns at most one example per card. A single payload cannot explain every valid representation, optional field, nested object, or discriminated branch.
PR #929 and issue #941 show the common
input/candidatenesting failure. PR #925 adds sparse-polynomial canonicalization prose and a specific example after repeated malformed calls. These are symptoms of a construction contract that exists outside the schema the host actually sees.Standards context
JSON Schema explicitly separates validation keywords from annotation keywords.
description,default, andexamplesdo not change acceptance, but they are intended to make schemas self-documenting and usable by documentation, form, and generation tooling:https://json-schema.org/understanding-json-schema/reference/annotations
MCP tool definitions use JSON Schema not only for server validation but also to guide clients and language models in constructing and understanding tool inputs:
https://modelcontextprotocol.io/specification/2025-11-25/server/tools
“Validation-equivalent” is therefore necessary but not sufficient for an agent-facing tool contract.
Root cause
The architecture treats one projection as though it can serve three different consumers:
Those consumers need the same constraints but different presentation. Removing every annotation minimizes bytes, while FULL maximizes audit completeness. There is no bounded middle representation optimized for call construction.
Proposed architecture
1. Distinguish canonical, validation, and generation projections
Keep one authoritative domain-owned schema contract, then expose explicit projections such as:
Names may differ. The projections must be derived from one source rather than maintained independently.
2. Preserve bounded semantic annotations in CONTRACT
CONTRACT should retain or separately project:
Apply explicit per-description, per-example, branch, and total byte limits. An omitted annotation needs a deterministic recovery path to the canonical schema resource rather than silent deletion.
3. Treat discriminators as generation-critical
Even where a JSON Schema discriminator is not required for validation semantics, it tells a host/model which property selects a branch. Preserve it in the construction schema and test
oneOf/anyOfrequests through supported clients.4. Validate annotations at registration
5. Feed schema-bound execution
The selected execution path in #1031 should give the host the construction-oriented schema, while authoritative runtime validation continues to use the canonical validation contract. Host-side generation remains an ergonomic layer, not a security boundary.
6. Provide canonical resources for large contracts
If the complete annotated schema is too large inline, return a compact typed construction projection plus a native
ResourceLink/URI to the exact canonical schema. Do not force the agent to choose FULL merely to recover one field description.Acceptance criteria
oneOf/anyOf/discriminated requests can be constructed without guessing a branch selector.inputandcandidateas siblings.Related work
math.findschema.Non-goals
defaultvalues unless the capability’s runtime contract explicitly defines that behavior.