Skip to content

Merged database tool style becomes the default for new MCP services - #70

Closed
nicdavidson wants to merge 1 commit into
developfrom
feat-merged-default
Closed

nicdavidson wants to merge 1 commit into
developfrom
feat-merged-default

Conversation

@nicdavidson

Copy link
Copy Markdown
Contributor

Summary

Prefixed style emits every database verb once per database, so five databases produce 80 near-identical tools that bloat client context and confuse tool selection (customer-reported). Merged style (PR #60) registers each verb once with a service argument. Per Nic's 2026-09-18 decision, merged is now the default for new MCP services.

  • McpServerConfig: the creating hook sets tool_style = 'merged' when a new row has none. The config-schema default becomes merged; labels are now "Merged with a service argument (default)" / "Prefixed per service (legacy)" and the description explains the trade-off and that existing servers keep prefixed until switched.
  • Migration for tool_style unchanged in behaviour (nullable, no backfill); only its doc comment was updated. Null still reads as prefixed in the daemon.
  • README: new "Database tool style (merged vs prefixed)" section with a comparison table.
  • Daemon unchanged.

Behaviour changes

Before: A newly created MCP service with no tool_style advertised prefixed tools (3 databases = 58 tools). The admin picklist defaulted to Prefixed.

After: A newly created MCP service defaults to merged tools (3 databases = 26 tools, each verb once with a service argument). The admin picklist defaults to Merged and labels Prefixed as legacy.

Upgrade impact: None for existing services. Rows created before this change keep their stored style; a null column still reads as prefixed in the daemon, so no existing client sees renamed tools. Admins creating new services who need prefixed names must pick "Prefixed per service (legacy)" explicitly.

How verified: tests/Unit/MergedToolStyleDefaultTest.php asserts the creating hook only fills tool_style when empty and that no saving/updating hook rewrites it, the schema default and labels, and that the migration has no ->default(, DB::, or ->update( backfill. df-core's storeConfig uses firstOrNew + save, so the creating hook fires for new rows only.

Testing

  • PHP suite (run inside df-development-web-1 against this checkout): OK (183 tests, 619 assertions).
  • cd daemon && npm test: 7 pass, 4 fail. The 4 failures are the lazy facade tests on develop that expect the old four-tool facade; daemon/ is byte-identical to origin/develop on this branch and PR test(daemon): expect list_tools in the lazy facade catalog #62 already fixes them.

Closes #65

Prefixed style emits every verb once per database, so five databases
produce 80 near-identical tools that bloat client context and confuse
tool selection. Merged style registers each verb once with a service
argument.

- McpServerConfig creating hook sets tool_style=merged when a new row
  has none; config-schema default and labels updated, prefixed marked
  legacy.
- Existing rows untouched: the tool_style column stays nullable with no
  backfill, and null still reads as prefixed in the daemon.
- README documents the setting and the default.
- Source-wiring test covers the hook, schema default, and migration.

Closes #65
@nicdavidson

Copy link
Copy Markdown
Contributor Author

Reviewed against the spec in #65: creating-hook default only (existing rows untouched, null still reads prefixed in the daemon), schema default and legacy labelling, no backfill, wiring test covers the hook and the migration's no-write guarantee. Behaviour-change notes match the diff. The 4 daemon test failures are develop's, fixed in #62. Holding the merge until the Tuesday review.

@nicdavidson

Copy link
Copy Markdown
Contributor Author

Integrated into the team branch feat/mcp-exposure (merge commit history preserved; see the draft PR from that branch to develop). Closing so develop stays untouched until the Tuesday comparison; the review notes above still apply.

@nicdavidson
nicdavidson deleted the feat-merged-default branch September 18, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant