Skip to main content
Glama
Hochfrequenz

TransformerBee.MCP

by Hochfrequenz

convert_edifact_to_bo4e

Convert EDIFACT messages to BO4E format for German energy market data exchange. This tool transforms standardized business documents between industry communication protocols.

Instructions

Convert an EDIFACT message to its BO4E equivalent

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
edifactYes
edifact_format_versionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function decorated with @mcp.tool that implements the convert_edifact_to_bo4e tool. It uses the TransformerBeeClient from the context to perform the conversion and handles errors, supporting only single Marktnachricht and transaction.
    @mcp.tool(description="Convert an EDIFACT message to its BO4E equivalent")
    async def convert_edifact_to_bo4e(
        ctx: Context,  # type:ignore[type-arg] # no idea what the second type arg is
        edifact: str,
        edifact_format_version: EdifactFormatVersion | None = None,
    ) -> dict[str, Any]:
        """Tool that uses initialized resources"""
        _logger.debug("Context: %s", str(ctx.request_context.lifespan_context))
        client: TransformerBeeClient = ctx.request_context.lifespan_context.transformerbeeclient
        if not edifact_format_version:
            edifact_format_version = get_current_edifact_format_version()
        try:
            marktnachrichten = await client.convert_to_bo4e(edifact=edifact, edifact_format_version=edifact_format_version)
        except ClientResponseError as cre:
            _logger.warning("transformer.bee rejected the request %s: %s", cre.request_info, cre.message)
            _logger.exception(cre)
            raise
        except Exception:
            _logger.exception("Error while converting EDIFACT to BO4E")
            raise
        if len(marktnachrichten) > 1:
            raise NotImplementedError(f"More than 1 Marktnachricht (got {len(marktnachrichten)}) not support yet")
        marktnachricht = marktnachrichten[0]
        await ctx.info(f"Successfully converted Marktnachricht with UNH {marktnachricht.unh} to BO4E")
        if len(marktnachricht.transaktionen) > 1:
            raise NotImplementedError(f"More than 1 transaction (got {len(marktnachricht.transaktionen)}) not support yet")
        transaktion = marktnachricht.transaktionen[0]
        return transaktion.model_dump(mode="json")
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the conversion action but reveals nothing about error handling, performance characteristics, authentication requirements, rate limits, or what happens with invalid input. This is inadequate for a transformation tool.

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 a single, efficient sentence with zero wasted words. It's appropriately sized for a straightforward conversion tool and front-loads the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (data format conversion), no annotations, and an output schema that presumably documents return values, the description is minimally adequate but leaves significant gaps. It identifies what the tool does but provides insufficient context for reliable agent use.

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

Parameters2/5

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

With 0% schema description coverage and 2 parameters, the description provides no information about parameter meanings, formats, or constraints. It mentions 'EDIFACT message' which hints at the 'edifact' parameter, but offers nothing about the optional 'edifact_format_version' parameter or its enum values.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'convert' and specifies both the input resource ('EDIFACT message') and output resource ('BO4E equivalent'), making the purpose unambiguous. However, it doesn't explicitly differentiate from its sibling tool 'convert_bo4e_to_edifact' beyond the direction of conversion.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, nor does it mention prerequisites, constraints, or typical use cases. The existence of a sibling tool suggests potential confusion that isn't addressed.

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/Hochfrequenz/TransformerBee.mcp'

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