Repository navigation
Description
Problem
LLMs discover MCP tools through three mechanisms:
- Server-level `instructions` — freeform text explaining when to use this server (like a system prompt)
- Tool `description` — per-tool explanation of purpose and usage
- Tool annotations — hints (`readOnlyHint`, `destructiveHint`, `idempotentHint`) that tell clients about tool behavior for autonomy/approval decisions
- Parameter `.describe()` — per-field hints
The sequant MCP server is missing server instructions entirely, has no tool annotations, and tool descriptions are too terse for LLMs to know when and how to use them effectively.
Why this matters
Block's testing showed LLM workflow adherence improved from 20% to 80% after adding server instructions. Tool annotations directly affect client UX — a `readOnlyHint: true` tool can be auto-approved, while the default assumption is destructive writes.
Current state
Server instructions: None (empty capabilities object)
Tool annotations: None on any tool. Defaults apply:
- `readOnlyHint: false` (assumes writes) — wrong for `sequant_status` and `sequant_logs`
- `destructiveHint: true` (assumes destructive) — wrong for all three tools
- `idempotentHint: false` (assumes not idempotent) — wrong for status and logs
Tool descriptions:
- `sequant_run`: "Run structured AI workflow phases (spec, exec, qa) for GitHub issues with quality gates" — no usage guidance, no example
- `sequant_status`: Good — has polling hint. But missing relationship to sequant_run.
- `sequant_logs`: "Get structured run logs for recent workflow executions" — thin, no info on data shape
Resource descriptions:
- `sequant://state`: "Current Sequant workflow state (.sequant/state.json)" — implementation detail, not purpose
- `sequant://config`: "Current Sequant configuration (.sequant/settings.json)" — same issue
Evidence
When testing the MCP server in Claude Code, the LLM successfully called all tools — but only because it was explicitly prompted. Without server instructions, an LLM has no context for when to proactively reach for these tools during a conversation about GitHub issues.
Acceptance Criteria
Server instructions
- AC-1: Server capabilities include an `instructions` field that explains what sequant is, when to use each tool, cross-tool relationships, and operational constraints (~150-200 words)
Tool annotations
- AC-2: `sequant_status` has annotations: `readOnlyHint: true, idempotentHint: true`
- AC-3: `sequant_logs` has annotations: `readOnlyHint: true, idempotentHint: true`
- AC-4: `sequant_run` has annotations: `readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true`
Tool descriptions
- AC-5: `sequant_run` description includes when to use it, what phases mean, and an example input
- AC-6: `sequant_status` description explains relationship to `sequant_run` (poll during active runs)
- AC-7: `sequant_logs` description includes what insights logs provide, when to check them, and `runId` format
- AC-8: `phases` parameter enumerates valid values (`spec`, `exec`, `qa`) not just "comma-separated"
Resource descriptions
- AC-9: Resource descriptions explain what data they contain and when to read them (not just file paths)
Tests
- AC-10: Existing tests pass; update schema assertions if they check descriptions
Design
Server instructions
const server = new McpServer(
{ name: "sequant", version },
{
instructions: [
"Sequant orchestrates AI-driven development workflows for GitHub issues.",
"Each issue progresses through phases: spec (plan) → exec (implement) → qa (review).",
"",
"Tools:",
"- sequant_status: Check issue progress. Poll every 5-10s during active runs. Always check before calling sequant_run.",
"- sequant_run: Execute workflow phases. Long-running (up to 30 min). Returns structured JSON on completion.",
"- sequant_logs: Review past run results and debug failures.",
"",
"Resources:",
"- sequant://state: Dashboard view of all tracked issues and their phases.",
"- sequant://config: Current workflow settings (timeout, phases, quality loop).",
"",
"Workflow: Check sequant_status first → sequant_run if needed → poll sequant_status → review sequant_logs on failure.",
"Do NOT call sequant_run for issues that are already merged or completed.",
].join("\n"),
capabilities: { tools: {}, resources: {} },
},
);Tool annotations
Following the filesystem MCP server pattern (the canonical reference):
// sequant_status — read-only, safe to call freely
server.registerTool("sequant_status", {
annotations: { readOnlyHint: true, idempotentHint: true },
// ...
});
// sequant_logs — read-only, safe to call freely
server.registerTool("sequant_logs", {
annotations: { readOnlyHint: true, idempotentHint: true },
// ...
});
// sequant_run — creates worktrees/PRs (additive, not destructive)
server.registerTool("sequant_run", {
annotations: {
readOnlyHint: false,
destructiveHint: false, // additive (creates, doesn't delete)
idempotentHint: false, // running twice creates duplicate work
openWorldHint: true, // interacts with GitHub, git
},
// ...
});Improved descriptions
See issue body section "Current state" for the gap. New descriptions should follow the pattern from the MCP filesystem server: 1-3 sentences, written for the LLM to select the tool, notable caveats called out inline.
Files in Scope
- `src/mcp/server.ts` — add `instructions` to constructor
- `src/mcp/tools/run.ts` — annotations + description + parameter descriptions
- `src/mcp/tools/status.ts` — annotations + description
- `src/mcp/tools/logs.ts` — annotations + description
- `src/mcp/resources.ts` — improve resource descriptions
References
- Block's Playbook for Designing MCP Servers — 20% → 80% workflow adherence with instructions
- MCP filesystem server annotations — canonical reference for annotation patterns
- MCP spec: Tool annotations — readOnlyHint, destructiveHint, idempotentHint, openWorldHint
- Server Instructions blog post
Non-goals
- Prompts — sequant skills (/spec, /exec, /qa) already serve this purpose
- Resource templates — sequant_status tool already covers per-issue queries
- outputSchema — current JSON text responses work; structured output is a separate concern
- Progress notifications — separate issue (different concern: runtime behavior vs discoverability)
Activity
admarble commentedon Mar 25, 2026
Spec Plan — #420 MCP Server Instructions & Tool Descriptions
AC Quality Check
✅ All 10 acceptance criteria are clear and testable.
Scope Assessment
Verdict: ✅ SCOPE_OK — Single coherent feature (MCP server metadata for LLM discoverability). All changes are additive string/object property additions across 5 files in
src/mcp/. The automated tool flagged 3 features due to high AC count, but these are granular-but-trivial items (adding strings and booleans).AC Checklist with Verification
instructionsfield (~150-200 words)src/mcp/server.tssequant_statusannotations: readOnly, idempotentlistTools()annotationssrc/mcp/tools/status.tssequant_logsannotations: readOnly, idempotentlistTools()annotationssrc/mcp/tools/logs.tssequant_runannotations: !readOnly, !destructive, !idempotent, openWorldlistTools()annotationssrc/mcp/tools/run.tssequant_rundescription: usage, phases, examplesrc/mcp/tools/run.tssequant_statusdescription: cross-tool relationshipsrc/mcp/tools/status.tssequant_logsdescription: insights, when, runId formatsrc/mcp/tools/logs.tsphasesparam enumeratesspec,exec,qasrc/mcp/tools/run.tslistResources()descriptionssrc/mcp/resources.tsnpm testsrc/mcp/server.test.tsDerived ACs:
| AC-11 | Integration tests for annotations in
listTools()| Integration Test |src/mcp/server.test.ts|| AC-12 | Integration test for
instructionsin server init | Integration Test |src/mcp/server.test.ts|Implementation Plan
Phase 1: Server instructions (
server.ts)instructionsstring toMcpServerconstructorServerOptionsPhase 2: Tool annotations + descriptions (
tools/*.ts)status.ts: AddreadOnlyHint: true, idempotentHint: trueannotationslogs.ts: AddreadOnlyHint: true, idempotentHint: trueannotations + improve descriptionrun.ts: AddreadOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: trueannotations + improve description + enumerate phases paramPhase 3: Resource descriptions (
resources.ts)sequant://stateandsequant://configdescriptions from file paths to purpose-oriented textPhase 4: Test updates (
server.test.ts)Design Review
src/mcp/— MCP server module. No cross-layer concerns.annotationsandinstructions.registerTool(name, config, callback)pattern — just addingannotationskey.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Well-defined with explicit code examples. All changes are additive metadata in 5 files.
feat(#420): add server instructions and improve MCP tool descriptions
admarble commentedon Mar 25, 2026
Exec Progress Update — #420
AC Coverage
instructionsfield (~150-200 words)src/mcp/server.ts:19-42— 14-line joined string covering workflow, tools, resources, and constraintssequant_statusannotations: readOnly, idempotentsrc/mcp/tools/status.ts—readOnlyHint: true, idempotentHint: truesequant_logsannotations: readOnly, idempotentsrc/mcp/tools/logs.ts—readOnlyHint: true, idempotentHint: truesequant_runannotations: !readOnly, !destructive, !idempotent, openWorldsrc/mcp/tools/run.ts— all 4 annotations setsequant_rundescription: usage, phases, examplesequant_statusdescription: cross-tool relationshipsequant_logsdescription: insights, when, runId formatphasesparam enumerates valid valuesspec,exec,qawith meaningsFiles Changed
src/mcp/server.ts— Addedinstructionsto McpServer constructor viaServerOptionssrc/mcp/tools/run.ts— Annotations, improved description, phases parameter enumerationsrc/mcp/tools/status.ts— Annotations, improved description with cross-tool relationshipsrc/mcp/tools/logs.ts— Annotations, improved description with data shape and format infosrc/mcp/resources.ts— Purpose-oriented descriptions for state and config resourcessrc/mcp/server.test.ts— 8 new tests (instructions, annotations, phases param, resource descriptions)src/mcp/server-extended.test.ts— Updated 1 assertion for case-sensitive description changeCHANGELOG.md— Added [Unreleased] entryQuality Gates
npm run buildnpm run lintnpm test(MCP)Self-Evaluation
ServerOptionstype required explicit typing due to McpServer constructor type narrowing, but this is the correct SDK pattern.PR
#427
admarble commentedon Mar 25, 2026
QA Review for Issue #420
AC Coverage
instructionsfield (~150-200 words)sequant_statusannotations: readOnly, idempotentreadOnlyHint: true, idempotentHint: trueverified atstatus.ts:23-24sequant_logsannotations: readOnly, idempotentreadOnlyHint: true, idempotentHint: trueverified atlogs.ts:50-51sequant_runannotations: !readOnly, !destructive, !idempotent, openWorldrun.ts:294-298sequant_rundescription: usage, phases, examplesequant_statusdescription: cross-tool relationshipsequant_logsdescription: insights, when, runId formatrun-<ISO>-<uuid>.json)phasesparam enumerates valid valuesspec,exec,qawith meanings and exampleCoverage: 10/10 AC items fully met
Quality Plan Verification
N/A - No quality plan found in issue comments (spec did not include Feature Quality Planning section)
CI Status
build (20.x)build (22.x)typecheckvalidate-skillsvalidate-pluginCI Summary: 5 passed, 0 pending, 0 failed
Quality Metrics
any)Build Verification
N/A - Build passed
Test Coverage Analysis
src/mcp/server.tssrc/mcp/server.test.ts(8 new tests)src/mcp/tools/run.tssrc/mcp/server.test.ts(annotation + phases tests)src/mcp/tools/status.tssrc/mcp/server.test.ts(annotation test)src/mcp/tools/logs.tssrc/mcp/server.test.ts(annotation test)src/mcp/resources.tssrc/mcp/server.test.ts(resource description tests)src/mcp/server.test.tssrc/mcp/server-extended.test.tsCHANGELOG.mdCoverage: 5/5 changed source files have corresponding tests. All tests use real MCP protocol clients (integration tests).
Code Review
Strengths:
ServerOptionstype import is the correct SDK pattern for typed optionsnot.toContain(".sequant/state.json")) prevent regression to file-path descriptionsIssues:
Suggestions:
Test Quality Review
Anti-Pattern Detection
Dependency Audit
N/A - No dependency changes in this commit
Code Patterns
No anti-patterns detected (no await-in-loop, empty catch, hardcoded secrets, etc.)
Call-Site Review
N/A - No new exported functions
Execution Evidence
N/A - No executable script changes (metadata-only changes to MCP server)
CHANGELOG Verification
Result: CHANGELOG requirements met
Stale Branch Check
Self-Evaluation
ServerOptions.instructionsis surfaced, or ifannotationsfield schema changes. Low risk since this uses the stable MCP SDK API.Verdict: READY_FOR_MERGE
All 10 ACs are met. Implementation is clean, focused, and well-tested. CI fully green. No issues found in code review.
Documentation
Next Steps
/docs 420if admin documentation is desired (optional for this change)admarble commentedon Mar 25, 2026
QA Review for Issue #420
AC Coverage
instructionsfield (~150-200 words)sequant_statusannotations: readOnly, idempotentreadOnlyHint: true, idempotentHint: trueverified atstatus.ts:23-24sequant_logsannotations: readOnly, idempotentreadOnlyHint: true, idempotentHint: trueverified atlogs.ts:49-50sequant_runannotations: !readOnly, !destructive, !idempotent, openWorldrun.ts:294-298sequant_rundescription: usage, phases, examplesequant_statusdescription: cross-tool relationshipsequant_logsdescription: insights, when, runId formatrun-<ISO>-<uuid>.json)phasesparam enumerates valid valuesspec,exec,qawith meanings and usage exampleCoverage: 10/10 AC items fully met
Quality Plan Verification
N/A - No quality plan found in issue comments
CI Status
build (20.x)build (22.x)typecheckvalidate-skillsvalidate-pluginCI Summary: 5 passed, 0 pending, 0 failed
Stale Branch Check
Feature branch is 3 commits behind main. Consider rebasing before merge, but not blocking.
Quality Metrics
any)Build Verification
N/A - Build passed
Test Coverage Analysis
src/mcp/server.tssrc/mcp/server.test.ts(8 new tests)src/mcp/tools/run.tssrc/mcp/server.test.ts(annotation + phases tests)src/mcp/tools/status.tssrc/mcp/server.test.ts(annotation test)src/mcp/tools/logs.tssrc/mcp/server.test.ts(annotation test)src/mcp/resources.tssrc/mcp/server.test.ts(resource description tests)src/mcp/server.test.tssrc/mcp/server-extended.test.tsCHANGELOG.mdCoverage: 5/5 changed source files have corresponding tests
Critical paths without tests: None
Code Review
Strengths:
ServerOptionstype import is the correct SDK pattern for typed constructor optionsnot.toContain(".sequant/state.json")) prevent regression to file-path descriptionsInMemoryTransport— testing the actual protocol surface LLM clients will seeIssues:
Suggestions:
Test Quality Review
Anti-Pattern Detection
Dependency Audit
N/A - No dependency changes
Code Patterns
No anti-patterns detected in changed files (no await-in-loop, empty catch, hardcoded secrets, SQL concatenation)
Call-Site Review
N/A - No new exported functions
Execution Evidence
N/A - No executable script changes (metadata-only changes to MCP server)
CHANGELOG Verification
Result: CHANGELOG requirements met
Self-Evaluation
ServerOptions.instructionsis surfaced or if theannotationsfield schema changes. Low risk — uses stable SDK API.Verdict: READY_FOR_MERGE
All 10 ACs are met. Implementation is clean, focused, and well-tested with integration tests via real MCP protocol. CI fully green. No issues found in code review.
Documentation
Next Steps
test(#420): add description content assertions for AC-5, AC-6, AC-7
docs(#420): update MCP server docs with instructions, annotations, an…
admarble commentedon Mar 25, 2026
Documentation Updated
File:
docs/features/mcp-server.md(updated existing doc)Changes:
sequant_logsparameter descriptions (runId prefix filtering, limit clarification)Sections Verified:
Ready to merge!
chore(#420): resolve merge conflicts with main
feat(#420): add server instructions and improve MCP tool descriptions (…
chore(#421): resolve merge conflicts with origin/main