Skip to main content
Glama
cmendezs

mcp-facture-electronique-fr

get_company_by_siren

Retrieve company details and registration status from the PPF directory using a SIREN number.

Instructions

Look up a company in the PPF directory by its SIREN number. Returns the full legal unit information: company name, administrative status, associated Approved Platform, and registration dates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sirenYesCompany SIREN number (9 digits, no spaces). Example: '123456789'. Returns the full legal unit information in the PPF directory, including registration status and Approved Platform.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for get_company_by_siren. Decorated with @mcp.tool(), it validates the SIREN input using _validate_siren (Luhn check), then delegates to DirectoryClient.get_company_by_siren for the actual HTTP GET /v1/siren/code-insee:{siren} call.
    @mcp.tool()
    async def get_company_by_siren(
        siren: Annotated[
            str,
            Field(
                description=(
                    "Company SIREN number (9 digits, no spaces). "
                    "Example: '123456789'. "
                    "Returns the full legal unit information in the PPF directory, "
                    "including registration status and Approved Platform."
                )
            ),
        ],
    ) -> dict:
        """
        Look up a company in the PPF directory by its SIREN number.
        Returns the full legal unit information: company name,
        administrative status, associated Approved Platform, and registration dates.
        """
        try:
            siren = _validate_siren(siren)
        except ValueError as exc:
            return {"error": str(exc)}
        client = get_directory_client()
        return await client.get_company_by_siren(siren=siren)
  • The input schema for the tool: a single required 'siren' parameter (Annotated[str, ...]) with Pydantic Field describing it as a 9-digit company SIREN number. The return type is dict.
    async def get_company_by_siren(
        siren: Annotated[
            str,
            Field(
                description=(
                    "Company SIREN number (9 digits, no spaces). "
                    "Example: '123456789'. "
                    "Returns the full legal unit information in the PPF directory, "
                    "including registration status and Approved Platform."
                )
            ),
        ],
    ) -> dict:
  • Registration function register_directory_tools(mcp) is called from server.py line 76. The tool is registered via the @mcp.tool() decorator at line 77 inside this function.
    def register_directory_tools(mcp: FastMCP) -> None:
        """Registers the 12 Directory Service tools on the FastMCP instance."""
    
        # ------------------------------------------------------------------
        # SIREN — Legal units
        # ------------------------------------------------------------------
  • Helper function _validate_siren that validates the SIREN: ensures it is 9 numeric digits and passes the Luhn check digit validation.
    def _validate_siren(value: str) -> str:
        """Return the stripped SIREN or raise ValueError if invalid."""
        v = value.strip()
        if not v.isdigit() or len(v) != 9:
            raise ValueError(f"SIREN must be exactly 9 digits, got {value!r}")
        if not _luhn_ok(v):
            raise ValueError(f"SIREN {value!r} fails Luhn check digit validation")
        return v
Behavior3/5

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

With no annotations, the description carries the behavioral burden. It describes a read-only operation returning specific data but does not disclose potential errors (e.g., SIREN not found), required permissions, rate limits, or side effects. It is not misleading but lacks completeness.

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 two sentences with no redundant information. It is front-loaded with the action and directly states what is returned, making it efficient and easy to parse.

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?

The tool has an output schema, so return values are covered. The description explains the purpose and main output but lacks mention of error handling (e.g., missing SIREN) or differentiation from similar tools. For a simple lookup, it is almost complete.

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 description coverage is 100%, so baseline is 3. The tool description adds minimal value beyond the schema's parameter description, mainly restating the returned information. No additional semantics like example values or constraints beyond what schema 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?

The description clearly states the action (look up), the resource (company in PPF directory), and the identifier (SIREN number). It also lists the returned information, making the purpose unambiguous and distinct from siblings like get_establishment_by_siret.

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?

The description implies usage for exact SIREN lookup but does not explicitly state when to use this tool versus alternatives like search_company or get_establishment_by_siret. There is no guidance on prerequisites or scenarios where it would be inappropriate.

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