Skip to main content
Glama
LuciferForge

agent-safety-mcp

by LuciferForge

kya_verify_card

Verify KYA identity cards by checking structure, completeness, and digital signatures to ensure authenticity and compliance.

Instructions

Verify a KYA identity card — check structure, completeness, and signature.

Args: agent_id: Look up a card created in this session by agent_id. card_json: Or pass raw card JSON to verify an external card.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idNo
card_jsonNo

Implementation Reference

  • The kya_verify_card tool handler which verifies the KYA identity card structure, completeness, and signature.
    def kya_verify_card(agent_id: str = "", card_json: str = "") -> dict:
        """Verify a KYA identity card — check structure, completeness, and signature.
    
        Args:
            agent_id: Look up a card created in this session by agent_id.
            card_json: Or pass raw card JSON to verify an external card.
        """
        if card_json:
            try:
                card = json.loads(card_json)
            except json.JSONDecodeError:
                return {"error": "Invalid JSON"}
        elif agent_id and agent_id in _kya_cards:
            card = _kya_cards[agent_id]
        else:
            return {"error": "Provide agent_id (from this session) or card_json"}
    
        # Write card to temp file for validate()
        card_path = _card_to_file(card)
        try:
            validation = validate(card_path)
        finally:
            os.unlink(card_path)
    
        score = compute_completeness_score(card)
    
        result = {
            "valid": validation.get("valid", False),
            "errors": validation.get("errors", []),
            "completeness_score": score,
            "agent_id": card.get("agent_id", "unknown"),
            "has_signature": "_signature" in card or "signature" in card,
        }
    
        if ("_signature" in card or "signature" in card) and _kya_key_name:
            from kya.signer import KEY_DIR
            pub_path = str(KEY_DIR / f"{_kya_key_name}.pub")
            if os.path.exists(pub_path):
                try:
                    verified = verify_card(card, pub_path)
                    result["signature_verified"] = verified.get("valid", False)
                except Exception:
                    result["signature_verified"] = False
    
        return result
  • The registration of the kya_verify_card tool using the @mcp.tool decorator.
    @mcp.tool()
Behavior3/5

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

Discloses what verification entails (structure, completeness, signature check). However, with no annotations provided, the description fails to confirm read-only safety, describe return values (boolean vs. report), or explain failure modes (exceptions vs. error codes).

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?

Four lines with zero redundancy. Purpose is front-loaded in the first sentence; Args section efficiently documents parameter semantics. Every sentence earns its place.

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?

Adequate for a two-parameter tool with simple types, covering inputs well. However, given no output schema and no annotations, the description should explain return values and safety profile (read-only status). Current coverage is minimum viable but has clear gaps.

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

Parameters5/5

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

Fully compensates for 0% schema description coverage. The Args section explains agent_id references session-created cards and card_json accepts external raw JSON, clarifying they are alternative input methods—critical semantics entirely missing from the schema titles.

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?

States specific verb 'Verify' and resource 'KYA identity card', and details what is checked (structure, completeness, signature). Clearly distinguishes from siblings kya_create_card and kya_sign_card by specifying the verification function.

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

Usage Guidelines4/5

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

Describes two mutually exclusive usage patterns: looking up 'a card created in this session' (referencing sibling kya_create_card workflow) versus passing external card JSON. Lacks explicit guidance on when to verify vs. other KYA operations, but provides clear context for the two input methods.

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