Skip to content

CONTRIBUTING tool template uses deprecated server.tool() and fails the registration test #149

Closed

Description

@TMHSDigital

Summary

The "Adding an MCP Tool" section tells contributors to use server.tool(...) without annotations; following it fails two registration tests.

Where

  • CONTRIBUTING.md:133-169
  • mcp-server/src/tools/__tests__/registration.test.ts:112-131

Details

Every tool uses server.registerTool(name, { description, inputSchema, annotations }, handler) with READ_ONLY, changesState() or destructive(). registration.test.ts requires annotations and fails any file containing server.tool(. The checklist also omits the README / CLAUDE.md / mcp-server/README / mcp-tools.json updates and counts that registration.test.ts:84-109 checks, the confirmParam/confirmCancelled helpers for state-changing tools, and HOMELAB_TEST_PI=true for the E2E suite.

Impact

A contributor following the documented pattern gets a PR that fails CI.

Steps to reproduce

  1. Copy the CONTRIBUTING snippet into src/tools/foo.ts and register it in index.ts
  2. npm test: the annotations and deprecated server.tool() tests fail

Suggested fix

Replace the snippet with the registerTool + annotations pattern, including the confirm-gated variant. Add the doc and count update steps and the E2E env var.

Acceptance criteria

  • Template compiles and passes registration tests when copied
  • Checklist lists every file the doc-sync test checks

Related: #122

Getting started

  • Relevant files: CONTRIBUTING.md, mcp-server/src/tools/__tests__/registration.test.ts
  • How to run tests: cd mcp-server && npm install && npm test (and npm run typecheck); structure tests: pip install -r requirements-test.txt && pytest tests/ -v
  • Conventions: see CLAUDE.md and CONTRIBUTING.md

Filed by repo-audit/full-audit at 636fefb. Severity: medium. Effort: S. audit-key: documentation|CONTRIBUTING.md|add-mcp-tool-template

Activity

  1. added
    documentation
    good first issue
    severity: medium
    on Nov 18, 2026
  2. TMHSDigital commented on Nov 19, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in b1cdb50: CONTRIBUTING now shows registerTool + READ_ONLY, a confirm-gated variant (confirmParam/confirmCancelled/destructive), and a checklist covering index.ts, tests (input-validation, handlers, confirm-gates, gated lists), every doc/count file registration.test.ts checks, CHANGELOG Unreleased, and HOMELAB_TEST_PI. Verified by copying both snippets into src/tools: they type-check and the read-only template passes the annotation and no-server.tool() tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationgood first issueseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions