Skip to content

fix(mcp): advertise _meta.category on all three servers - #10162

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-10038
Jul 31, 2026
Merged

fix(mcp): advertise _meta.category on all three servers#10162
JSONbored merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-10038

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

fix(mcp): advertise _meta.category on all three servers

registerStdioTool and registerMinerTool were the only two tool-registration
wrappers that never attached _meta, so the stdio server's locally-registered
tools and the miner's entire surface carried no category on the wire even
though the contract's projection has always had one. Both now spread
_meta: { category } from the same projected definition they already use for
title/description/annotations.

checkAdvertisedMetadata gains the matching branch so a server that stops
sending it fails validate:mcp instead of drifting silently again.

Closes #10038

registerStdioTool and registerMinerTool were the only two tool-registration
wrappers that never attached _meta, so the stdio server's locally-registered
tools and the miner's entire surface carried no category on the wire even
though the contract's projection has always had one. Both now spread
_meta: { category } from the same projected definition they already use for
title/description/annotations.

checkAdvertisedMetadata gains the matching branch so a server that stops
sending it fails validate:mcp instead of drifting silently again.
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 31, 2026 10:13
@loopover-orb

loopover-orb Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-31 10:42:54 UTC

5 files · 1 AI reviewer · no blockers · readiness 93/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds `_meta: { category: advertised.category }` to the two tool-registration wrappers (registerStdioTool, registerMinerTool) that were previously omitting it, closing a real gap where the stdio server's locally-registered tools and the miner's entire tool surface carried no category on the wire despite the registry projection always having one. It also adds a matching branch in `checkAdvertisedMetadata` so future regressions of this kind fail validate:mcp, plus targeted unit and integration regression tests. The fix is applied at the correct layer (the registration call site using the same `advertised` projection already used for title/description/annotations), and the new tests exercise the real servers rather than fabricating state.

Nits — 4 non-blocking
  • The `_meta.category` fix is repeated near-identically at two call sites (loopover-mcp.ts and loopover-miner-mcp.ts) — worth noting for future maintainers that any third registration wrapper needs the same treatment, since nothing enforces it structurally.
  • test/unit/validate-mcp-helpers.test.ts's `projected` helper now hardcodes `category: "utility"` as a default override, which is fine but slightly obscures that `category` is otherwise unset unless explicitly overridden.
  • Consider whether `checkAdvertisedMetadata`'s new category check could be factored alongside the existing annotation-hint loop for consistency, though this is purely stylistic.
  • The file-size flag on loopover-mcp.ts pre-dates this PR (a 1-line addition in a 929-line file) and isn't something this diff should be asked to fix.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #10038
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ⚠️ 20/25 Preflight is ready, but the PR body does not name the validation run.
Contributor workload ✅ 10/10 Author activity: 119 registered-repo PR(s), 82 merged, 3 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bitfathers94; Gittensor profile; 119 PR(s), 3 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff adds `_meta: { category: advertised.category }` sourced from the same projected definition in both `registerStdioTool` and `registerMinerTool`, extends `ListedTool`/`checkAdvertisedMetadata` to model and validate `_meta.category`, adds the required unit test branches (missing `_meta`, disagreeing category) in the existing test file, and adds a named regression test verifying `tools/list`

Review context
  • Author: bitfathers94
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 119 PR(s), 3 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add validation command/output.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.21%. Comparing base (1a2b41a) to head (251cac2).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10162   +/-   ##
=======================================
  Coverage   92.21%   92.21%           
=======================================
  Files         931      931           
  Lines      114066   114066           
  Branches    27546    27546           
=======================================
  Hits       105183   105183           
  Misses       7584     7584           
  Partials     1299     1299           
Flag Coverage Δ
backend 95.68% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-mcp/bin/loopover-mcp.ts 70.03% <ø> (ø)
packages/loopover-miner/bin/loopover-miner-mcp.ts 98.00% <ø> (ø)

@JSONbored
JSONbored merged commit 236907c into JSONbored:main Jul 31, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp(contract): advertise _meta.category on all three servers and assert it in checkAdvertisedMetadata

2 participants