Skip to main content
Glama
cmendezs

mcp-facture-electronique-fr

update_routing_code

Update an existing routing code in the PPF directory. Rename the value or change its label without recreating the entry.

Instructions

Partially update an existing routing code in the PPF directory (PATCH semantics).

Only the fields explicitly provided are modified; omitted fields keep their current values. Use to rename a routing code value or update its label without recreating it.

BEHAVIOR:

  • Returns the updated routing code object on success.

  • Fails with 404 if the instanceId does not exist.

  • Fails if the new routing_code value is already used by another routing code on the same SIRET (duplicate).

  • Updating routing_code renames it in-place; existing directory lines referencing it are updated automatically.

  • Providing neither routing_code nor label is a no-op (returns the unchanged object).

RESPONSE: the full updated routing code object — instanceId, siret, siren, routingCode, label, updatedAt.

USAGE GUIDELINES:

  • Retrieve the instanceId first via search_routing_code if you only know the routing code value.

  • Prefer updating the label for cosmetic changes; only change routing_code if the identifier itself must change (e.g. department renamed), since senders may have cached the old value.

  • To delete and replace a routing code entirely, use delete on the old instanceId and create_routing_code for the new one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYesInstance identifier of the routing code to update. Obtained from create_routing_code or search_routing_code response. Required — there is no lookup by routing_code value directly.
routing_codeNoNew routing code value (replaces the existing one). Must be unique for the associated SIRET. Omit to leave the current value unchanged.
labelNoNew descriptive label for the routing code. Omit to leave the current label unchanged.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for update_routing_code. Registers a @mcp.tool() async function that returns an error explaining the API was removed in XP Z12-013 v1.2.0; updates must be done via the Approved Platform portal.
    @mcp.tool()
    async def update_routing_code(
        instance_id: Annotated[
            str,
            Field(
                description=(
                    "Instance identifier of the routing code to update. "
                    "Obtained from create_routing_code or search_routing_code response. "
                    "Required — there is no lookup by routing_code value directly."
                )
            ),
        ],
        routing_code: Annotated[
            Optional[str],
            Field(
                default=None,
                description=(
                    "New routing code value (replaces the existing one). "
                    "Must be unique for the associated SIRET. "
                    "Omit to leave the current value unchanged."
                ),
            ),
        ] = None,
        label: Annotated[
            Optional[str],
            Field(
                default=None,
                description=(
                    "New descriptive label for the routing code. "
                    "Omit to leave the current label unchanged."
                ),
            ),
        ] = None,
    ) -> dict:
        """
        Partially update an existing routing code in the PPF directory (PATCH semantics).
    
        Only the fields explicitly provided are modified; omitted fields keep their current values.
        Use to rename a routing code value or update its label without recreating it.
    
        BEHAVIOR:
        - Returns the updated routing code object on success.
        - Fails with 404 if the instanceId does not exist.
        - Fails if the new routing_code value is already used by another routing code on the same SIRET (duplicate).
        - Updating routing_code renames it in-place; existing directory lines referencing it are updated automatically.
        - Providing neither routing_code nor label is a no-op (returns the unchanged object).
    
        RESPONSE: the full updated routing code object — instanceId, siret, siren, routingCode, label, updatedAt.
    
        USAGE GUIDELINES:
        - Retrieve the instanceId first via search_routing_code if you only know the routing code value.
        - Prefer updating the label for cosmetic changes; only change routing_code if the identifier itself must change
          (e.g. department renamed), since senders may have cached the old value.
        - To delete and replace a routing code entirely, use delete on the old instanceId and create_routing_code for the new one.
        """
        return {
            "error": (
                "update_routing_code is not available. "
                "PATCH /v1/routing-code/id-instance was removed in XP Z12-013 v1.2.0. "
                "Routing code updates must be performed through your Approved Platform portal."
            )
        }
  • Input schema for update_routing_code defined via Pydantic Field annotations: instance_id (required string), routing_code (optional string), label (optional string).
    @mcp.tool()
    async def update_routing_code(
        instance_id: Annotated[
            str,
            Field(
                description=(
                    "Instance identifier of the routing code to update. "
                    "Obtained from create_routing_code or search_routing_code response. "
                    "Required — there is no lookup by routing_code value directly."
                )
            ),
        ],
        routing_code: Annotated[
            Optional[str],
            Field(
                default=None,
                description=(
                    "New routing code value (replaces the existing one). "
                    "Must be unique for the associated SIRET. "
                    "Omit to leave the current value unchanged."
                ),
            ),
        ] = None,
        label: Annotated[
            Optional[str],
            Field(
                default=None,
                description=(
                    "New descriptive label for the routing code. "
                    "Omit to leave the current label unchanged."
                ),
            ),
        ] = None,
    ) -> dict:
        """
        Partially update an existing routing code in the PPF directory (PATCH semantics).
    
        Only the fields explicitly provided are modified; omitted fields keep their current values.
        Use to rename a routing code value or update its label without recreating it.
    
        BEHAVIOR:
        - Returns the updated routing code object on success.
        - Fails with 404 if the instanceId does not exist.
        - Fails if the new routing_code value is already used by another routing code on the same SIRET (duplicate).
        - Updating routing_code renames it in-place; existing directory lines referencing it are updated automatically.
        - Providing neither routing_code nor label is a no-op (returns the unchanged object).
    
        RESPONSE: the full updated routing code object — instanceId, siret, siren, routingCode, label, updatedAt.
    
        USAGE GUIDELINES:
        - Retrieve the instanceId first via search_routing_code if you only know the routing code value.
        - Prefer updating the label for cosmetic changes; only change routing_code if the identifier itself must change
          (e.g. department renamed), since senders may have cached the old value.
        - To delete and replace a routing code entirely, use delete on the old instanceId and create_routing_code for the new one.
        """
  • The register_directory_tools() function decorates all directory tool handlers including update_routing_code with @mcp.tool().
    def register_directory_tools(mcp: FastMCP) -> None:
  • Client-level helper method for update_routing_code. Raises NotImplementedError because the underlying API endpoint was removed.
    async def update_routing_code(
        self,
        instance_id: str,
        routing_code: Optional[str] = None,
        label: Optional[str] = None,
    ) -> dict[str, Any]:
        """PATCH /v1/routing-code/id-instance:{id} — REMOVED in XP Z12-013 v1.2.0."""
        raise NotImplementedError(
            "PATCH /v1/routing-code/id-instance was removed in XP Z12-013 v1.2.0. "
            "Routing code updates are now managed through the Approved Platform portal."
        )
Behavior5/5

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

No annotations provided, so description carries full burden. Details include success response (full updated object), error cases (404 if missing, duplicate routing_code), side effects (automatic update of references), and no-op condition. This fully discloses behavioral traits beyond any structured metadata.

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?

Well-structured with clear sections (main description, BEHAVIOR, RESPONSE, USAGE GUIDELINES). Front-loaded with core purpose. Every sentence conveys useful information without redundancy. Appropriate length for a tool with 3 parameters and important behavioral details.

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 tool with 3 parameters (1 required) and no annotations, the description is comprehensive. It covers all error scenarios, side effects, response format, and usage prerequisites. Output schema existence is noted, but description already describes response fields. No gaps remain for effective agent usage.

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

Parameters4/5

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

Input schema has 100% coverage with good descriptions, so baseline is 3. Description adds value by explaining PATCH semantics (only provided fields updated) and clarifying duplicate constraint for routing_code. This goes beyond schema but does not significantly enhance parameter meaning beyond what schema already provides.

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 'Partially update an existing routing code in the PPF directory (PATCH semantics)'. It specifies the action (partial update), resource (routing code), and HTTP semantics. Differentiates from siblings by explicitly contrasting with delete/create and providing usage guidance.

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?

Explicit when-to-use: 'Use to rename a routing code value or update its label without recreating it.' When-not-to: 'To delete and replace... use delete... and create_routing_code.' Also provides retrieval prerequisite via search_routing_code and recommends preferring label updates over routing_code changes.

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