feat(mcp-bridge): add MCP annotations + outputSchema to all tools; Teranga scoped surface#75
Merged
Conversation
…ranga scoped surface
Three quality upgrades to the MCP bridge, none of which touch the
existing AAA-tier `description` or `inputSchema` text (the 120-char
min / 200-char mean coherence floor is preserved).
1. MCP annotations on every advertised tool
Each of the 65 tools (object literals plus every ghTools/glTools
entry) now carries an `annotations` block with a Title-Case `title`
and the four MCP-spec behaviour hints (readOnlyHint, destructiveHint,
idempotentHint, openWorldHint), derived honestly from each tool's
documented semantics. coord_* and the local discovery/dispatch core
are openWorldHint:false (loopback/local only); all external-system
tools are openWorldHint:true. Only the genuinely destructive
mutations (boj_github_merge_pr, coord_approve, coord_reject,
boj_gitlab_setup_mirror) are destructiveHint:true.
2. outputSchema on every advertised tool
A JSON-Schema `type:"object"` return descriptor with a top-level
description and an explicit additionalProperties flag. Fully
enumerated where the description already states the shape
(boj_health, boj_browser_navigate, coord_register, ...); honest
pass-through (`additionalProperties:true`) for opaque upstream
cartridge/provider payloads rather than inventing fields.
3. Teranga scoped tool surface (Glama Server Coherence lever)
New BOJ_TOOL_SCOPE env var read in buildToolList():
- unset / "full" : advertise every tool (DEFAULT — full
backward compatibility, no client sees a
change unless they opt in).
- "core" : advertise only boj_health, boj_menu,
boj_cartridges, boj_cartridge_info,
boj_cartridge_invoke + ALL coord_* tools.
- CSV of prefixes : core + named explicit domain groups
(e.g. "core,github,browser").
The unified-endpoint thesis is fully preserved: every explicit
boj_<domain>_* tool stays reachable through boj_cartridge_invoke
regardless of scope. Narrowing the advertised surface changes
discovery only, not capability — exactly what the coherence
sub-score rewards.
main.js: tools/list passes whole tool objects through verbatim, so
annotations + outputSchema reach the wire with no whitelisting; the
`tools` capability now advertises listChanged:true. glama.json and
docs/glama/SERVER_CONFIGURATION.md document BOJ_TOOL_SCOPE and the
preserved unified endpoint. dispatch_test.js gains three coherence
tests (annotations completeness, outputSchema shape, BOJ_TOOL_SCOPE
back-compat); all 11 tests pass, existing tests untouched.
Note: the prior Glama "C" grade was a stale pre-AAA inspection — the
descriptions/inputSchemas were already upgraded; this commit closes
the remaining annotations / outputSchema / coherence gaps so a
re-inspection reflects the current surface.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 28 issues detected
View findings[
{
"reason": "Stale AI session file -- delete",
"type": "stale",
"file": "GEMINI.md",
"action": "delete",
"rule_module": "root_hygiene",
"severity": "medium"
},
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/sanctify-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/academic-workflow-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/fireflag-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/ephapax-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/bofig-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/hesiod-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
hyperpolymath
enabled auto-merge (squash)
May 18, 2026 09:54
🔍 Hypatia Security ScanFindings: 28 issues detected
View findings[
{
"reason": "Stale AI session file -- delete",
"type": "stale",
"file": "GEMINI.md",
"action": "delete",
"rule_module": "root_hygiene",
"severity": "medium"
},
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/sanctify-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/academic-workflow-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/fireflag-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/ephapax-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/bofig-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/hesiod-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
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
Quality upgrade to the MCP bridge surface: every advertised tool now
carries MCP-spec
annotationsand a JSON-SchemaoutputSchema, and anew
BOJ_TOOL_SCOPEenv var lets operators shrink the advertisedsurface (a Glama Server Coherence lever) without losing any capability.
No existing
descriptionorinputSchemawas rewritten or shortened —the AAA-tier 120-char min / 200-char mean coherence floor is preserved.
Stale-score finding
The previous Glama C grade was a stale pre-AAA inspection. The
tool descriptions and input schemas had already been upgraded to
AAA-tier (rich prose, enums, ranges, patterns, sibling
disambiguation). The only remaining gaps — confirmed by grep — were
zero MCP
annotations, zerooutputSchema, and 41+ tools alwaysadvertised. This PR closes exactly those gaps so a re-inspection
reflects the current surface, not the old one.
Per-task changes
1. MCP annotations (
mcp-bridge/lib/tools.js)Every tool (object literals + every
ghTools/glToolsentry via anannfield) gets anannotationsblock: Title-Casetitleplus thefour boolean hints. Derived honestly from documented semantics:
openWorldHint:falseforcoord_*(loopback bus) and the localdiscovery/dispatch core;
truefor all external-system tools.destructiveHint:trueonly forboj_github_merge_pr,coord_approve,coord_reject,boj_gitlab_setup_mirror.idempotentHint:truefor status/health/setter-style coord ops andboj_health.2. outputSchema (
mcp-bridge/lib/tools.js)A
type:"object"return descriptor with a non-empty top-leveldescriptionand an explicitadditionalPropertieson every tool.Fields fully enumerated where the description already states the shape;
honest pass-through (
additionalProperties:true) for opaque upstreamcartridge/provider payloads — no invented fields.
3. main.js wiring
tools/listpasses whole tool objects through verbatim (no fieldwhitelisting), so
annotations+outputSchemareach the wireunmodified.
toolscapability now advertiseslistChanged:true.4. Teranga scoped surface
BOJ_TOOL_SCOPEread inbuildToolList():full— every tool (DEFAULT, fully backward-compatible).core—boj_health,boj_menu,boj_cartridges,boj_cartridge_info,boj_cartridge_invoke+ allcoord_*.core,github,browser) — core + named groups.Verified counts:
full=65,core=28 (5 + 23 coord_*),core,github,browser=49. Every explicitboj_<domain>_*tool staysreachable via
boj_cartridge_invokein every mode — theunified-endpoint thesis is intact. Documented in
glama.jsonenv blockand
docs/glama/SERVER_CONFIGURATION.md.Test additions (
mcp-bridge/tests/dispatch_test.js)Existing 8 tests untouched. Added 3:
annotationsblock (non-empty stringtitle+ four boolean hints);outputSchema(type:"object",non-empty description, explicit
additionalProperties);BOJ_TOOL_SCOPEunset advertises the full surface (back-compat) andcoreis a strict subset that keepsboj_cartridge_invoke+ thecoord_*unit.npm test: 11/11 pass. eslint clean on all changed files.Post-merge
@hyperpolymath/boj-serverso theregistry artifact carries the new annotations/outputSchema surface.
🤖 Generated with Claude Code