Skip to content

Improvement: the same agent workflows are written in three places: the dialogs' prompts, the MCP server's prompts and its instructions #4976

Open

Description

@yannickmonney

Summary

The connect dialogs hand a person four prompts (#4958, #4959, #4965, #4966). Three of them restate a workflow that the MCP server already carries as a prompt, and each is stated a third time in the instructions every agent reads when it connects. The texts are written for different moments, so they differ on purpose: a first message the person pastes, a command an agent client lists, and the lines an agent reads at initialize. Nothing ties them to one another except a check that the tools they name exist. This issue lists the overlaps and what holds them together today. It states no preference.

What the repository says (main at 8a0732529c)

Workflow Server instructions (services/platform/lib/mcp/instructions.ts) MCP prompt (lib/mcp/prompts.ts) Dialog prompt (messages/en/codingAgent.yml)
Change an automation :27 the loop get_automation, edit, validate, run, test, save; :38 read get_docs once; :59 save with baseVersion edit_automation with a name (:85-159) prompt.edit (:28)
Create an automation :59 "create: true for a new automation" edit_automation without a name (the same spec) prompt.create (:30)
Look into a failed run :81-84 read it with get_run and the record, fix the document, reproduce with run_automation debug_failed_run (:161-199) prompt.run (:29)
A first look at what the agent can do here prompt.general (:27)

The dialog texts have German and French twins; the server's texts are English only ("Agent-facing English, a public API like the tool descriptions", instructions.ts:7-8).

Where they differ today

  • The dialog's edit prompt does not include a mock run (run_automation) or the baseVersion and message guidance; edit_automation has both (prompts.ts:85-159), and the instructions give baseVersion (instructions.ts:59).
  • The dialog's run prompt does not name list_connectors, list_agent_secrets and list_models, which debug_failed_run names for a cause outside the document; it keeps "never ask me to paste a secret".
  • The MCP prompts attach the automation or the run record to the message as resources; a pasted prompt cannot.

What holds them together

  • The instructions are assembled from fragments that each name their tools, and a fragment ships only when every one of its tools exists (instructions.ts:10-15; the guard also keeps the text inside the 2,048 characters Claude Code reads).
  • The MCP prompts and the dialog prompts are each checked against the tool inventory (lib/mcp/prompts.test.ts, app/features/coding-agent/lib/prompts.test.ts).
  • Nothing compares the steps of one place with those of another.

What was not examined

  • How clients other than Claude Code surface MCP prompts (the guide covers Claude Code at docs/en/develop/use-tale-from-your-editor.md:419).
  • Whether an agent that reads both a pasted prompt and the server's instructions behaves differently from one that reads one.
  • Whether the differences above matter to the result.

Options (no preference stated)

  1. Accept the three places.
  2. A guard: the tools each text names, in order, must agree between a dialog prompt and its MCP prompt, or differ only by a written allow-list.
  3. One source: render the dialog's text from the MCP prompt's spec, without the attached resources.
  4. Have the dialog's prompt call the MCP prompt for clients that list prompts, and keep text only for the others. Which clients list prompts was not examined.
  5. Shorten the dialog's prompt to a line that points the agent at the server's instructions.

Questions

  • Which place is the source of truth for a workflow?
  • Do the dialogs' prompts need to differ from the MCP prompts at all?

Related

#4975, #4958, #4959, #4965, #4966

Activity

  1. added
    priority: low
    needs discussion
    improvement
    service: platform
    on Oct 13, 2026
  2. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    ContributorAuthor

    Decision

    Rule: the MCP prompt spec (services/platform/lib/mcp/prompts.ts) is the single source of truth for a workflow's steps and their order: edit_automation for edit and create, debug_failed_run for a failed run. Each other place that restates a workflow is held to the spec by a test:

    • Server instructions keep the rules for every workflow and a one-line loop summary.
    • The skill (lib/mcp/skill.ts, a fourth place this issue did not list) keeps its teaching sections.
    • The connect dialogs:
      • With the Claude Code tab selected, the edit, create and run contexts hand over the prompt command itself (/tale:edit_automation <name>, /tale:edit_automation, /tale:debug_failed_run <runId>). It is built in code from the server name and the spec. The choice follows the selected tab, not the client name the connection reports about itself.
      • Codex and Other keep a localized pasted prompt that reads the automation or run explicitly and is otherwise aligned to the spec.
      • prompt.general stays as it is.

    The guard: for each workflow, the core sequence is the tools the spec's lines name, in order, each kept at its last mention. Every place must contain that sequence in the same order. It may add or repeat tools. It may leave one out only through an allow-list entry with a written reason, and a stale entry fails the test.

    Answers

    • Source of truth? The MCP prompt spec for a workflow's steps. The server instructions for the rules that apply to every workflow.
    • Do the dialogs' prompts need to differ? Only where the medium forces it: the person's language, a bracketed place for their request, and explicit reads instead of attachments. Claude Code gets the command, so nothing differs there. The rest is drift and gets fixed:
      • the missing mock run_automation;
      • the missing baseVersion;
      • the missing list_connectors, list_agent_secrets and list_models;
      • get_docs placed before the read of the automation.

    Rationale

    Agents act on these texts, and the pasted edit prompt today skips the mock run and baseVersion. A guard tied to the spec catches drift like that, but only if its rule is precise. The spec names save_automation twice for create, and its lines depend on the branch taken. The last-mention, subsequence rule handles both and still lets places add tools. Handing Claude Code the command removes a copy. In edit_automation's not-readable branch, the agent asks before creating under the given name. Without that, a tale server signed in to another organization would turn an edit into a stray create.

    Why not the other options:

    • Rendering the dialog from the spec: English text in German and French dialogs.
    • A pointer to the instructions: loses the workflow, because the instructions are a 2,048-character summary.
    • Accepting three places: leaves the existing drift.

    Implementation units

    1. fix(platform): align the dialogs' workflow prompts with the MCP prompts (S, main)
      • en, de and fr, written in the spec's order.
      • Edit: get_automation, then get_docs, validate, mock run_automation, test, then save with baseVersion and a one-line message.
      • Create: list_automations, then get_docs, validate, mock run, test, then save with create: true.
      • Run: the list_* sentence comes after the save step.
    2. test(platform): hold every restated workflow to its MCP prompt (M, main, after 1)
      • New lib/mcp/workflows.test.ts: the subsequence rule over the dialog locales, the skill's two sections and the instructions' two fragments.
      • A reasoned allow-list. Stale entries fail.
    3. feat(platform): hand Claude Code the Tale prompt command in the connect dialogs (M, main, after 1)
      • The command, built from MCP_SERVER_NAME and MCP_PROMPTS, with a schema test.
      • The not-readable branch asks before it creates.
      • Sweep: en, de and fr strings and docs, manual boxes (including the wrong-organization case) and the copy button's label.
    4. test(platform): observe which other clients list MCP prompts (S, main, after 3)

    Cross-issue amendments (decisions taken together with #4975, #4972):

  3. added
    agent-ready
    and removed
    needs discussion
    on Nov 14, 2026
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

    agent-readyimprovementpriority: lowservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions