Skip to main content
Glama

Project pain.001 into a face

project_face
Read-onlyIdempotent

Convert a pain.001 document into UK Open Banking, Berlin Group, or ISO 20022 JSON and list any source elements the target omits.

Instructions

Project a pain.001 document into another standard's JSON shape.

Use this to turn a payment file into the request body a UK Open
Banking or Berlin Group API expects, or into ISO 20022 element names,
and to see exactly what the target cannot carry: the loss report
lists every source element left out, by indexed path. A face never
invents a value: when the target requires an element the document
lacks, the answer is an ``{"error": ...}`` naming it. To check the
document itself first, use ``validate_xml_against_schema``.

Delegates to :func:`pain001.faces.project_face_text`.

Args:
    xml_content: The pain.001 document as XML text.
    face: The target face.
    version: The edition, or ``None`` to detect it.
    bindings: Side inputs the face accepts, or ``None``.

Returns:
    ``{"face", "version", "payload", "loss_report"}``, or
    ``{"error": ...}`` when the face refuses the document or a
    binding, or the installed pain001 has no faces.

Input Schema

NameRequiredDescriptionDefault
faceYesThe target face: one of 'berlin_group', 'iso_2018', 'uk_open_banking'.
versionNoThe pain.001 edition, e.g. 'pain.001.001.09'; omit to detect it from the document's namespace.
bindingsNoValues the message does not carry, keyed as list_faces names them (e.g. {'ConsentId': '...'} for uk_open_banking); used for this call only.
xml_contentYesThe full pain.001 document as XML text (not a file path), at most 10 MiB.

Output Schema

NameRequiredDescriptionDefault
faceNo
errorNo
payloadNo
versionNo
loss_reportNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.0.78

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already flag it as a safe read (readOnly/idempotent/non-destructive), yet the description still adds real behavior: a loss_report enumerates every dropped source element by indexed path, no value is ever invented, and a required-but-missing target element yields an {'error': ...} payload. It also discloses the failure mode when the installed pain001 has no faces.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and loss-report behavior are front-loaded in the first two sentences, which is good. But the prose is wrapped in docstring scaffolding (Args/Returns, double-backtick markup) that repeats schema content and costs tokens without adding selection value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a projection tool with four params, rich annotations, and an output schema, the description covers the aspects the structured data cannot: what the loss report means, the never-invent-a-value guarantee, and the error shape. Nothing needed to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and each parameter already has a description, so the schema carries parameter meaning; the description's Args block largely restates it. The one piece of added meaning is framing bindings/version around the refusal behavior, which is marginal over the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Project') and resource ('pain.001 document') plus the concrete targets (UK Open Banking, Berlin Group, ISO 20022 element names), which clearly separates it from siblings like validate_xml_against_schema or parse_camt053.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Use this to turn a payment file into the request body a UK Open Banking or Berlin Group API expects' gives an explicit when-to-use, and 'To check the document itself first, use validate_xml_against_schema' names the alternative for the adjacent task. Routing is unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.