Skip to main content
Glama
cmendezs

mcp-einvoicing-be

check_peppol_participant_be

Check if a Belgian company is registered as a Peppol participant by querying the Peppol SMP/SML network. Returns registration status, supported document types, and SMP endpoint.

Instructions

Check whether a Belgian company is registered as a Peppol participant.

Queries the Peppol SMP/SML network. If a plain VAT number is provided it is converted to the Belgian Peppol scheme (ICD 0208 for KBO/BCE numbers).

Returns registration status, supported document type identifiers, and the SMP access point endpoint URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYesPeppol participant ID (e.g. '0208:0123456789') or plain Belgian VAT number

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that checks whether a Belgian company is registered as a Peppol participant. Queries the Peppol SMP/SML network. Accepts a participant ID (e.g. '0208:0123456789') or a plain Belgian VAT number.
    async def check_peppol_participant_be(
        identifier: Annotated[
            str,
            "Peppol participant ID (e.g. '0208:0123456789') or plain Belgian VAT number",
        ],
    ) -> dict[str, object]:
        """Check whether a Belgian company is registered as a Peppol participant.
    
        Queries the Peppol SMP/SML network. If a plain VAT number is provided it
        is converted to the Belgian Peppol scheme (ICD 0208 for KBO/BCE numbers).
    
        Returns registration status, supported document type identifiers, and the
        SMP access point endpoint URL.
        """
        if ":" not in identifier:
            digits = normalize_vat_be(identifier)[2:]  # strip 'BE'
            participant_id = f"0208:{digits}"
        else:
            participant_id = identifier
    
        scheme, value = participant_id.split(":", 1)
        path = f"/iso6523-actorid-upis::{scheme}:{value}"
    
        client = _peppol_client()
        try:
            response = await client._request("GET", path)
        except PlatformError as exc:
            if exc.status_code == 404:
                return {
                    "registered": False,
                    "participant_id": participant_id,
                    "error": "Participant not found on Peppol network",
                }
            raise
    
        return {
            "registered": True,
            "participant_id": participant_id,
            "raw": response.text,
        }
  • The tool is registered on the MCP server via mcp.tool()(check_peppol_participant_be) inside _register_be_tools.
    def _register_be_tools(mcp: Any) -> None:
        """Register all Belgian e-invoicing tools onto the shared FastMCP instance."""
        mcp.tool()(_validator.validate_invoice_be)
        mcp.tool()(_validator.validate_pint_be)
        mcp.tool()(_generator.generate_invoice_be)
        mcp.tool()(transform_to_ubl)
        mcp.tool()(lookup_vat_be)
        mcp.tool()(check_peppol_participant_be)
        mcp.tool()(get_invoice_types_be)
  • Module docstring lists the tool; imports provide typed annotations (Annotated type hints) used in the handler's parameter signature.
    """Lookup tools: lookup_vat_be, check_peppol_participant_be, get_invoice_types_be."""
    
    import os
    from typing import Annotated
    
    from mcp_einvoicing_core import AuthMode, BaseEInvoicingClient, PlatformError
    
    from mcp_einvoicing_be.standards.peppol_bis_3 import INVOICE_TYPES
    from mcp_einvoicing_be.utils.helpers import normalize_vat_be
  • The normalize_vat_be helper normalizes Belgian VAT numbers to 'BE' + 10 digits, used by the handler to convert plain VAT numbers to the Peppol participant ID format.
    def normalize_vat_be(vat_number: str) -> str:
        """Normalize a Belgian VAT/enterprise number to 'BE' + 10-digit format.
    
        Accepts:
        - ``BE0123456789``
        - ``0123456789``
        - ``BE 0123.456.789``
        - ``0123.456.789``
    
        Raises ``ValueError`` if the result is not exactly 10 digits.
        """
        cleaned = re.sub(r"[\s.\-]", "", vat_number.upper())
        digits = cleaned[2:] if cleaned.startswith("BE") else cleaned
    
        if not re.fullmatch(r"\d{10}", digits):
            raise ValueError(
                f"Invalid Belgian VAT/enterprise number: {vat_number!r}. "
                "Expected 10 digits (with optional 'BE' prefix)."
            )
    
        return f"BE{digits}"
Behavior4/5

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

Discloses network query (Peppol SMP/SML), VAT number conversion, and returned fields (registration status, document types, endpoint URL). With no annotations, it provides substantial behavioral context, though lacks details on potential errors or limitations.

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?

Three sentences, front-loaded with purpose, efficient. Every sentence adds value without redundancy.

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?

Given one parameter and existence of output schema, description covers conversion logic, network query, and return information. Complete for its complexity.

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

Parameters5/5

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

Schema has 100% coverage for identifier, but description adds meaning by explaining accepted formats (Peppol ID or plain VAT) and automatic conversion to Belgian scheme. Adds value beyond schema description.

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 checks Peppol registration for a Belgian company. Verb 'Check whether...registered' and resource 'Peppol participant' are specific. Distinguishes from sibling tools like lookup_vat_be which is VAT-specific.

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?

Implies usage for Peppol registration checks but does not explicitly state when to use alternatives or provide exclusion criteria. No mention of when to prefer this over lookup_vat_be or other tools.

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-be'

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