aeat.entrypoints.mcp._prompts module

Guided-workflow prompts: the user-controlled entry points of the console.

MCP prompts are the slash-command surface a client renders for the USER to pick (ADR R4): invoking one drops the matching shipped skill — verbatim, as an embedded resource — plus a short operating brief into the conversation, so the model enters the workflow already carrying the playbook and its rules of engagement. The catalogue is DERIVED from the shipped skill documents and their structured applies_when metadata, never hand-listed, so a new skill ships as a new prompt with zero registration and the surface cannot drift from the data (aeat-registry-authority-flow discipline applied to the harness).

Like _tools and _dispatch, this module is SDK-independent pure functions over typed models; _server adapts PromptDocument to the MCP SDK’s prompt types, mirroring how build_sdk_tools adapts descriptors.

exception PromptNotFoundError[source]

Bases: LookupError

Raised when a prompt name does not resolve to a shipped guided workflow.

class PromptArgumentSpec(**data)[source]

Bases: BaseModel

One declared argument a guided-workflow prompt accepts (ADR P5).

SDK-independent; _server adapts it to the MCP PromptArgument type. All workflow arguments are optional - a workflow can start without a period and resolve it conversationally - so required defaults False.

Parameters:
name: str
description: str
required: bool
class GuidedPrompt(**data)[source]

Bases: BaseModel

One entry in the prompt catalogue (the prompts/list row).

Parameters:
name: str
title: str
description: str
skill_name: str
arguments: tuple[PromptArgumentSpec, ...]
class EmbeddedDocument(**data)[source]

Bases: BaseModel

A document embedded into the prompt’s returned messages as a resource.

Parameters:
uri: str
mime_type: str
text: str
class PromptDocument(**data)[source]

Bases: BaseModel

The materialised prompts/get payload for one guided workflow.

brief_text is the operating brief that precedes the embedded documents in the returned user message; embedded carries the skill (and, for the orientation prompt, the operator rules) verbatim so the client needs no follow-up resource read for the workflow to be fully loaded.

Parameters:
prompt: GuidedPrompt
brief_text: str
embedded: tuple[EmbeddedDocument, ...]
build_prompt_catalogue()[source]

Return the prompt catalogue: one guided workflow per shipped skill, plus orientation.

Sorted by name for deterministic prompts/list output. Every skill’s frontmatter is validated on the way through (a malformed skill fails loudly here rather than shipping a broken prompt).

Return type:

tuple[GuidedPrompt, ...]

Returns:

A GuidedPrompt.

prompt_document(name, arguments=None)[source]

Materialise one guided workflow’s prompts/get payload.

arguments are the client-supplied prompt arguments (filing year, period); when present they are appended to the operating brief as an explicit scope so the model enters the workflow already knowing the period it targets.

Raises:

PromptNotFoundError – When name is neither the orientation prompt nor a shipped skill’s workflow.

Return type:

PromptDocument

Returns:

A PromptDocument.

Parameters: