MCP: status tool, self-describing empty results, explicit done-filter error#1362
Merged
Merged
Conversation
…lter error Kill the "silent empty result" failure mode in the transcripted-mcp server: - New read-only `status` tool: server version, resolved meeting/dictation directories, which resolution rule selected them (plus legacy-fallback flag), index directory, and indexed counts (meetings, dictation days, dictation entries, summary items, summarized meetings, summaries_indexed). - Zero-result responses from list_meetings, list_dictations, search, search_context, recent_context, recap, list_action_items, list_decisions, and digest now return a JSON payload with searched_directories, the relevant indexed counts, and a hint that distinguishes "nothing indexed" from "nothing matched". Non-empty responses are byte-identical to before. - list_action_items with status "done" now returns an explicit MCP error (saved summaries do not track completion state) instead of compiling to an always-empty SQL filter; "open" and "all" behave as before. The tool's inputSchema description says so too. Supporting changes: - TranscriptedCaptureKit: additive `resolutionSource` enum (env_data_dir / env_kind_dirs / app_manifest / app_preference / default) and `legacyFallbackAppended` flag on ResolvedCaptureDirectories; existing call sites (TranscriptedCLI, e2e smoke) compile unchanged. - TranscriptedDataDirectories carries the two new fields through to the status handler. - TranscriptIndex.counts() adds small COUNT queries over the derived tables. - Main.swift now sources its version string from a single `serverVersion` constant reused by --version, the Server handshake, and the status tool. - Tests: status payload shape, empty-result hint fields (meetings, dictations, mixed, rollups), done-filter error, and resolver resolution-source assertions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GuGZaFRmNrqfGPpqf7WH4n
11 tasks
Owner
Author
|
Merge-room hold: draft plus MCP/CaptureKit package proof is missing. Live state checked 2026-07-02: head |
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.
Why
The MCP server's dominant failure mode is silent emptiness: an agent getting
[]can't distinguish "no data" from "wrong directory" from "index not built" from "feature needs summaries enabled" — so it confidently tells the user they have no meetings. Specific offenders from the agent-surface audit: no runtime introspection at all (the--self-testdiagnostics are unreachable from an MCP client), rollup tools that are empty for anyone without saved summaries, andlist_action_itemsstatus:"done"compiling toAND 1=0.Product Impact
agent artifactsagent workflowWhat changed
statustool (13th tool, read-only): server version, resolved meeting/dictation directories, which resolution rule won (env_data_dir/env_kind_dirs/app_manifest/app_preference/default), whether legacy fallback dirs were appended, index directory, and indexed counts (meetings, dictation days/entries, summary items, summarized meetings,summaries_indexed).TranscriptedCaptureKit: additiveCaptureLibraryResolutionSourceenum +resolutionSource/legacyFallbackAppendedonResolvedCaptureDirectories(new init params defaulted; the CLI call site compiles unchanged).searched_directories, scope-relevant indexed counts, and ahintthat distinguishes "nothing indexed — call the status tool" from "nothing matched these filters". Rollup tools explain that they only cover meetings with saved summaries. Non-empty responses are byte-identical.status:"done"now errors explicitly ("not tracked in saved summaries yet; use open or all") instead of returning a silent empty set; tool schema/description updated. The defensiveAND 1=0stays at the index layer.Main.swiftnow has a singleserverVersionconstant reused by--version, the startup log,Server(version:), andstatus.TranscriptIndex.counts()with 5 small COUNT queries.Tools/TranscriptedMCP/CLAUDE.md:statusrow, done-filter note, empty-result gotcha, refreshed file index.How I checked it
scripts/dev/agent-preflight.sh.agents/test-matrix.yml— CaptureKit rule = package-test union + e2e smokeswift test --package-path Tools/TranscriptedCaptureKit+Tools/TranscriptedCLI+Tools/TranscriptedMCP+bash run-e2e-smoke.sh— all run by Swift CI on macOS at this exact head (802ff5f), green: https://github.com/r3dbars/transcripted/actions/runs/28621577716 (the workflow runs the full matrix: build, fast tests, Coreswift test, integration smoke, e2e smoke, and all four Tools package suites)Authoring context: written in a Linux session with no local Swift toolchain; verification is the green macOS Swift CI run above (required merge gate, same matrix as local runs).
Risk Review
statusand empty-result fields expose local paths to the local MCP client only (same trust boundary asread_meetingreturning transcript text).agent-review/visuals/evidence — n/aNotes
Part of the agent-surface audit series (#1356–#1361) and step 2 of the consolidation plan in #1358. Known behavior change: empty responses switch from plain text ("No meetings found.") to structured JSON — intentional, that's the fix. One judgment call: with only one per-kind env override set,
resolution_sourcereportsenv_kind_dirseven though the other kind resolved lower in the chain (commented in the resolver).#1363 (read-path pagination) stacks on this branch because both touch
ToolHandlers.swift— merge this first.Agent handoff
COORD_DONE: GREEN | (this PR) | status tool + self-describing empties + done-filter error | none | none | Swift CI green at head 802ff5f (full matrix incl. all package tests + e2e) | human review + mark ready + merge, then #1363🤖 Generated with Claude Code
https://claude.ai/code/session_01GuGZaFRmNrqfGPpqf7WH4n