Skip to main content
Glama
LuciferForge

agent-safety-mcp

by LuciferForge

kya_sign_card

Sign KYA cards with Ed25519 private keys to create secure audit trails for agent safety verification.

Instructions

Sign an existing KYA card with the session's Ed25519 private key.

Args: agent_id: The agent_id of the card to sign. Must call kya_create_card first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYes

Implementation Reference

  • The kya_sign_card function implements the logic to sign an existing KYA card using the Ed25519 private key.
    @mcp.tool()
    def kya_sign_card(agent_id: str) -> dict:
        """Sign an existing KYA card with the session's Ed25519 private key.
    
        Args:
            agent_id: The agent_id of the card to sign. Must call kya_create_card first.
        """
        if agent_id not in _kya_cards:
            return {"error": f"No card found for agent_id '{agent_id}'. Create one first."}
    
        if _kya_key_name is None:
            return {"error": "No keypair generated. Call kya_generate_keypair first."}
    
        from kya.signer import KEY_DIR
        priv_path = str(KEY_DIR / f"{_kya_key_name}.key")
        if not os.path.exists(priv_path):
            return {"error": f"Private key not found at {priv_path}"}
    
        try:
            signed = sign_card(_kya_cards[agent_id], priv_path)
            _kya_cards[agent_id] = signed
            return {
                "status": "signed",
                "agent_id": agent_id,
                "has_signature": "_signature" in signed or "signature" in signed,
            }
        except Exception as e:
            return {"error": str(e)}
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the use of Ed25519 private keys and the prerequisite call requirement. However, it lacks disclosure of mutation semantics (idempotency, what happens on re-sign), return value structure, or error conditions (e.g., if agent_id doesn't exist), which are critical for a cryptographic signing operation.

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 efficiently structured with a clear action statement followed by an Args block. There is no redundant text; every sentence serves to clarify purpose, mechanism, or parameter usage. The length is appropriate for the tool's complexity.

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 low complexity (single string parameter, no output schema), the description adequately covers the essential workflow context and cryptographic method. It is missing only edge case documentation (e.g., already-signed cards), which prevents a perfect score given the lack of structured metadata.

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?

Schema description coverage is 0%, leaving the description to compensate. The Args section effectively documents the single parameter by explaining it represents 'the card to sign' and reinforcing the prerequisite constraint. It successfully adds necessary semantic meaning absent from the schema.

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 specific action ('Sign'), the resource ('existing KYA card'), and the mechanism ('session's Ed25519 private key'). The mention of 'existing' effectively distinguishes this from the sibling kya_create_card, while 'Sign' distinguishes it from kya_verify_card.

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?

Explicitly states the prerequisite workflow constraint: 'Must call kya_create_card first.' This provides clear sequencing guidance and explicitly names the required preceding sibling tool, removing ambiguity about when to use this tool.

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/LuciferForge/agent-safety-mcp'

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