Skip to main content
Glama
cmendezs

mcp-einvoicing-de

peppol_check

Verifies a German company's Peppol registration for e-invoicing via AS4. Performs live DNS+SMP lookup to return registration status, supported document types, and AS4 endpoint URL.

Instructions

Verify whether a German company is registered on the Peppol network and can receive electronic invoices via AS4. Performs a live DNS + SMP lookup using the participant's Peppol ID (Leitweg-ID, GLN, or VAT number). Returns registration status, supported document types, and AS4 endpoint URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
participant_idYesPeppol participant ID, e.g. '0204:991-1234512345-06'.
document_typeNoPeppol document type identifier (default: BIS Billing 3.0).
environmentNoproduction

Implementation Reference

  • Async handler that validates input, performs Peppol DNS+SMP lookup via PeppolSMPClient, builds output model, and returns JSON result.
    async def handle_peppol_check(arguments: dict[str, Any]) -> list[types.TextContent]:
        """MCP handler for peppol_check."""
        try:
            params = PeppolCheckInput.model_validate(arguments)
        except Exception as exc:
            return [types.TextContent(type="text", text=json.dumps(format_error(str(exc))))]
    
        try:
            pid = PeppolParticipantId.parse(params.participant_id)
        except ValueError as exc:
            return [types.TextContent(type="text", text=json.dumps(format_error(str(exc))))]
    
        environment = (
            PeppolEnvironment.TEST
            if params.environment == "test"
            else PeppolEnvironment.PRODUCTION
        )
        client = PeppolSMPClient(environment=environment)
    
        try:
            lookup = await client.lookup_participant(pid)
        except EInvoicingError as exc:
            return [types.TextContent(type="text", text=json.dumps(format_error(str(exc))))]
    
        document_type_supported: bool | None = None
        access_point_url: str | None = None
        transport_profile: str | None = None
    
        if lookup.is_registered and params.document_type:
            document_type_supported = params.document_type in lookup.supported_document_types
            if document_type_supported:
                try:
                    service = await client.get_service_endpoint(
                        pid, params.document_type, smp_hostname=lookup.smp_hostname
                    )
                    access_point_url = service.endpoint_url
                    transport_profile = service.transport_profile
                except EInvoicingError as exc:
                    logger.warning("Service endpoint fetch failed: %s", exc)
    
        output = PeppolCheckOutput(
            is_registered=lookup.is_registered,
            participant_id=str(pid),
            document_type_supported=document_type_supported,
            access_point_url=access_point_url,
            transport_profile=transport_profile,
            lookup_details=lookup.to_dict(),
            error=lookup.error,
        )
        return [types.TextContent(type="text", text=output.model_dump_json(indent=2))]
  • PeppolCheckInput Pydantic model: participant_id (required), document_type (default BIS Billing 3.0), environment (production/test).
    class PeppolCheckInput(BaseModel):
        """Input schema for peppol_check."""
    
        participant_id: str = Field(
            ...,
            description=(
                "Peppol participant identifier in the format <scheme>:<value>. "
                "Examples: '0204:991-1234512345-06' (Leitweg-ID), "
                "'0088:4012345678901' (GLN), '9930:DE123456789' (VAT)."
            ),
        )
        document_type: str = Field(
            PEPPOL_BIS_BILLING_30,
            description=(
                "Peppol document type identifier to check capability for. "
                "Defaults to BIS Billing 3.0. "
                "[NEED: confirm DE PINT document type identifier once standardised]"
            ),
        )
        environment: str = Field(
            "production",
            description="Peppol environment: 'production' or 'test'.",
        )
  • PeppolCheckOutput Pydantic model: is_registered, participant_id, document_type_supported, access_point_url, transport_profile, lookup_details, error.
    class PeppolCheckOutput(BaseModel):
        """Output schema for peppol_check."""
    
        is_registered: bool
        participant_id: str
        document_type_supported: bool | None = Field(
            None, description="True if the participant supports the requested document type."
        )
        access_point_url: str | None = Field(
            None, description="AS4 endpoint URL of the participant's access point."
        )
        transport_profile: str | None = None
        lookup_details: dict[str, Any] = Field(default_factory=dict)
        error: str | None = None
  • TOOL_PEPPOL_CHECK: types.Tool definition with name='peppol_check', description, and input JSON schema.
    TOOL_PEPPOL_CHECK = types.Tool(
        name="peppol_check",
        description=(
            "Verify whether a German company is registered on the Peppol network "
            "and can receive electronic invoices via AS4. "
            "Performs a live DNS + SMP lookup using the participant's Peppol ID "
            "(Leitweg-ID, GLN, or VAT number). "
            "Returns registration status, supported document types, and AS4 endpoint URL."
        ),
        inputSchema={
            "type": "object",
            "required": ["participant_id"],
            "properties": {
                "participant_id": {
                    "type": "string",
                    "description": "Peppol participant ID, e.g. '0204:991-1234512345-06'.",
                },
                "document_type": {
                    "type": "string",
                    "description": "Peppol document type identifier (default: BIS Billing 3.0).",
                },
                "environment": {
                    "type": "string",
                    "enum": ["production", "test"],
                    "default": "production",
                },
            },
        },
    )
  • Server imports TOOL_PEPPOL_CHECK and handle_peppol_check, adds to _ALL_TOOLS list and _TOOL_HANDLERS dict for dispatch.
    from mcp_einvoicing_de.tools.peppol_check import TOOL_PEPPOL_CHECK, handle_peppol_check
    from mcp_einvoicing_de.tools.tax_rules import TOOL_TAX_RULES, handle_tax_rules
    
    LOG_LEVEL = os.environ.get("EINVOICING_DE_LOG_LEVEL", "INFO").upper()
    logging.basicConfig(level=getattr(logging, LOG_LEVEL, logging.INFO))
    logger = logging.getLogger(__name__)
    
    _ALL_TOOLS: list[types.Tool] = [
        TOOL_INVOICE_CREATE,
        TOOL_INVOICE_VALIDATE,
        TOOL_INVOICE_PARSE,
        TOOL_INVOICE_CONVERT,
        TOOL_PEPPOL_CHECK,
        TOOL_TAX_RULES,
    ]
    
    _TOOL_HANDLERS: dict[str, Any] = {
        "invoice_create": handle_invoice_create,
        "invoice_validate": handle_invoice_validate,
        "invoice_parse": handle_invoice_parse,
        "invoice_convert": handle_invoice_convert,
        "peppol_check": handle_peppol_check,
        "tax_rules": handle_tax_rules,
    }
Behavior4/5

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

No annotations provided, but description discloses that the tool performs a live DNS and SMP lookup, which is a network call. It does not claim any destructive behavior. It mentions return values (registration status, document types, endpoint). A minor gap: no mention of potential network latency or caching behavior.

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

Conciseness5/5

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

Two dense sentences with no redundant language. Every clause adds value: the action, method, input, and output are all covered efficiently.

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

Completeness4/5

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

Given no output schema, description compensates by listing return fields (registration status, document types, endpoint). Tool is simple with 3 parameters (1 required) and no nested objects. Description is sufficient for an agent to understand purpose and expected output, though error handling or special cases could enhance completeness.

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 67% with descriptions for participant_id and document_type. Description adds a concrete example for participant_id and notes default for document_type. Environment parameter is implicitly clarified by enum. Some added value beyond schema, but not substantial.

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?

Description clearly states the tool verifies Peppol registration for German companies using a live DNS+SMP lookup. It specifies the verb 'verify' and the resource 'Peppol registration', and distinguishes from sibling invoice tools by focusing on network registration check.

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

Usage Guidelines3/5

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

Description does not explicitly state when to use this tool versus alternatives. It implies usage when needing to check Peppol registration before sending invoices, but lacks comparisons to other tools or exclusion criteria.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cmendezs/mcp-einvoicing-de'

If you have feedback or need assistance with the MCP directory API, please join our Discord server