Skip to main content
Glama
cmendezs

mcp-facture-electronique-fr

create_directory_line

Register an electronic invoice receiving address in the French PPF directory by specifying the SIREN and platform ID, with optional SIRET and routing code for establishment-level routing.

Instructions

Create a directory line (electronic invoice receiving address) for a taxable entity. Required to register in the PPF directory and allow other companies to send you electronic invoices. A line can be at SIREN level (entire company), SIREN/SIRET (one establishment), or SIREN/SIRET/routing-code (a specific department).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sirenYesSIREN of the taxable entity (9 digits) creating this receiving address.
platform_idYesIdentifier of the Approved Platform that will receive the invoices (provided by your AP upon registration).
siretNoSpecific establishment SIRET (14 digits). If absent, the line applies to all establishments under the SIREN.
routing_codeNoRouting code to refine the receiving address (must exist via create_routing_code).
technical_addressNoAP-specific technical receiving address (endpoint, mailbox, etc.). Format defined by the Approved Platform.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for create_directory_line. Decorated with @mcp.tool(), defines parameters (siren, platform_id required; siret, routing_code, technical_address optional) and calls the DirectoryClient's create_directory_line method.
    @mcp.tool()
    async def create_directory_line(
        siren: Annotated[
            str,
            Field(
                description="SIREN of the taxable entity (9 digits) creating this receiving address."
            ),
        ],
        platform_id: Annotated[
            str,
            Field(
                description=(
                    "Identifier of the Approved Platform that will receive the invoices "
                    "(provided by your AP upon registration)."
                )
            ),
        ],
        siret: Annotated[
            Optional[str],
            Field(
                default=None,
                description=(
                    "Specific establishment SIRET (14 digits). "
                    "If absent, the line applies to all establishments under the SIREN."
                ),
            ),
        ] = None,
        routing_code: Annotated[
            Optional[str],
            Field(
                default=None,
                description=(
                    "Routing code to refine the receiving address "
                    "(must exist via create_routing_code)."
                ),
            ),
        ] = None,
        technical_address: Annotated[
            Optional[str],
            Field(
                default=None,
                description=(
                    "AP-specific technical receiving address "
                    "(endpoint, mailbox, etc.). "
                    "Format defined by the Approved Platform."
                ),
            ),
        ] = None,
    ) -> dict:
        """
        Create a directory line (electronic invoice receiving address)
        for a taxable entity. Required to register in the PPF directory and
        allow other companies to send you electronic invoices.
        A line can be at SIREN level (entire company), SIREN/SIRET
        (one establishment), or SIREN/SIRET/routing-code (a specific department).
        """
        client = get_directory_client()
        return await client.create_directory_line(
            siren=siren,
            platform_id=platform_id,
            siret=siret,
            routing_code=routing_code,
            technical_address=technical_address,
        )
  • Input schema/validation for create_directory_line using Pydantic Field annotations: siren (str, required), platform_id (str, required), siret (Optional[str]), routing_code (Optional[str]), technical_address (Optional[str]).
    async def create_directory_line(
        siren: Annotated[
            str,
            Field(
                description="SIREN of the taxable entity (9 digits) creating this receiving address."
            ),
        ],
        platform_id: Annotated[
            str,
            Field(
                description=(
                    "Identifier of the Approved Platform that will receive the invoices "
                    "(provided by your AP upon registration)."
                )
            ),
        ],
        siret: Annotated[
            Optional[str],
            Field(
                default=None,
                description=(
                    "Specific establishment SIRET (14 digits). "
                    "If absent, the line applies to all establishments under the SIREN."
                ),
            ),
        ] = None,
        routing_code: Annotated[
            Optional[str],
            Field(
                default=None,
                description=(
                    "Routing code to refine the receiving address "
                    "(must exist via create_routing_code)."
                ),
            ),
        ] = None,
        technical_address: Annotated[
            Optional[str],
            Field(
                default=None,
                description=(
                    "AP-specific technical receiving address "
                    "(endpoint, mailbox, etc.). "
                    "Format defined by the Approved Platform."
                ),
            ),
        ] = None,
  • Registration function register_directory_tools that when called registers create_directory_line (and all other directory tools) on the FastMCP instance via @mcp.tool() decorator.
    def register_directory_tools(mcp: FastMCP) -> None:
        """Registers the 12 Directory Service tools on the FastMCP instance."""
  • DirectoryClient.create_directory_line - the HTTP client method that POSTs to /v1/directory-line with siren, platformId, and optional siret, routingCode, technicalAddress.
    async def create_directory_line(
        self,
        siren: str,
        platform_id: str,
        siret: Optional[str] = None,
        routing_code: Optional[str] = None,
        technical_address: Optional[str] = None,
    ) -> dict[str, Any]:
        """POST /v1/directory-line — Create a directory line."""
        body: dict[str, Any] = {"siren": siren, "platformId": platform_id}
        if siret:
            body["siret"] = siret
        if routing_code:
            body["routingCode"] = routing_code
        if technical_address:
            body["technicalAddress"] = technical_address
        response = await self._request("POST", "/v1/directory-line", json=body)
        return response.json()
Behavior3/5

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

With no annotations, the description implies a write operation but lacks details on side effects, error conditions, permissions, or idempotency. It does explain the granularity of lines, which adds some behavioral context.

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?

The description is concise (53 words) and front-loaded, with the main action stated first. Every sentence adds essential information without redundancy.

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 the presence of an output schema, the description sufficiently explains the tool's purpose and the granularity options. It could mention return values or confirmation, but overall it provides solid context.

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%, so baseline is 3. The description adds value by explaining the levels (SIREN/SIRET/routing-code) which correspond to parameters, but the schema already describes each parameter adequately.

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?

The description clearly states the tool creates a directory line for electronic invoice receiving addresses, specifying its purpose for PPF registration and invoice reception. It distinguishes from sibling tools like create_routing_code by focusing on receiving addresses.

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

Usage Guidelines4/5

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

The description explains when to use (for registering in PPF directory and receiving invoices) and provides context about the different levels (SIREN, SIRET, routing-code). However, it does not explicitly exclude cases or mention alternatives like updating or deleting lines.

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-facture-electronique-fr'

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