Public: anyone can read this; the crew can change it.

MCP `app_domains` refuses in the same sentence as the app's settings page and the terminal, not `the domain is refused: invalid_host` #7606

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

MCP `app_domains` now uses the same words as the settings page and the terminal, for refusals and for successes. `tsc` is clean and `test/mcp-app-domains.test.ts` and `test/mcp-size.test.ts` pass. I didn't run the full suite; the forge's check runs it on the push.

shipped production is serving it deploy fbaec5d

opened this

MCP app_domains now uses the same words as the settings page and the terminal, for refusals and for successes. tsc is clean and test/mcp-app-domains.test.ts and test/mcp-size.test.ts pass. I didn't run the full suite; the forge's check runs it on the push.

  • Refusals: the message comes from domainRefusalText(code, fallback). The error code is unchanged, so clients should match on that field. The fallbacks are the page's own: "That domain could not be added." for add, NO_SUCH_DOMAIN for check, remove and list. not_found keeps its repository message.
  • add: the answer is the domain view plus says from domainAddedText.
  • check: the answer is the domain view plus says from domainSaidText.
  • remove: the answer was {}; it is now { says } from domainRemovedText.
  • Tests: a new test checks that the MCP message for invalid_host, reserved_host and taken contains the text domainRefusalText gives, and the existing tests cover the says fields. Both the page and the MCP tool take that text from the same function, so the new test compares against it rather than rendering the page.

I changed the remove assertion in the existing test from {} to { says } because the answer changed.

I left the docs/MCP.md row as it is.

Closes #7596

commented

MCP app_domains now uses the same words as the settings page and the terminal, for refusals and for successes. tsc is clean and test/mcp-app-domains.test.ts and test/mcp-size.test.ts pass. I didn't run the full suite; the forge's check runs it on the push.

  • Refusals: the message comes from domainRefusalText(code, fallback). The error code is unchanged, so clients should match on that field. The fallbacks are the page's own: "That domain could not be added." for add, NO_SUCH_DOMAIN for check, remove and list. not_found keeps its repository message.
  • add: the answer is the domain view plus says from domainAddedText.
  • check: the answer is the domain view plus says from domainSaidText.
  • remove: the answer was {}; it is now { says } from domainRemovedText.
  • Tests: a new test checks that the MCP message for invalid_host, reserved_host and taken contains the text domainRefusalText gives, and the existing tests cover the says fields. Both the page and the MCP tool take that text from the same function, so the new test compares against it rather than rendering the page.

I changed the remove assertion in the existing test from {} to { says } because the answer changed.

I left the docs/MCP.md row as it is.

Approved

Clean. app_domains now takes refusals and success text from domain_words.ts, the same functions the settings page and the terminal use. Error codes are unchanged and not_found keeps its own message. No new input, no new write path, no new dependency; authorization still happens in the unchanged action calls. The new test would fail without the change. Optional follow-up: the docs/MCP.md row could mention the says field.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs