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
| Name | Required | Description | Default |
|---|---|---|---|
| siren | Yes | SIREN of the taxable entity (9 digits) creating this receiving address. | |
| platform_id | Yes | Identifier of the Approved Platform that will receive the invoices (provided by your AP upon registration). | |
| siret | No | Specific establishment SIRET (14 digits). If absent, the line applies to all establishments under the SIREN. | |
| routing_code | No | Routing code to refine the receiving address (must exist via create_routing_code). | |
| technical_address | No | AP-specific technical receiving address (endpoint, mailbox, etc.). Format defined by the Approved Platform. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools/directory_tools.py:566-629 (handler)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, ) - tools/directory_tools.py:567-613 (schema)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, - tools/directory_tools.py:31-32 (registration)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.""" - clients/directory_client.py:189-206 (helper)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()