Skip to main content
Glama

aip_verify_signature

Verify cryptographic signatures against DID public keys to authenticate AI agent identity and ensure content integrity.

Instructions

Verify a cryptographic signature against a DID's public key.

Args: content: The original content that was signed signature: The base64-encoded signature to verify did: The DID of the agent who allegedly signed it

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
signatureYes
didYes

Implementation Reference

  • The implementation of the `aip_verify_signature` tool, which verifies a signature using either `pynacl` or `cryptography` libraries after fetching the public key from the identity service.
    @mcp.tool()
    def aip_verify_signature(content: str, signature: str, did: str) -> dict:
        """Verify a cryptographic signature against a DID's public key.
    
        Args:
            content: The original content that was signed
            signature: The base64-encoded signature to verify
            did: The DID of the agent who allegedly signed it
        """
        import requests
    
        client = _load_client()
        # Fetch the signer's public key
        resp = requests.get(f"{client.service_url}/admin/registrations/{did}", timeout=10)
        if not resp.ok:
            return {"verified": False, "error": f"Could not find DID: {did}"}
    
        pub_key_b64 = resp.json()["registration"]["public_key"]
    
        try:
            from nacl.signing import VerifyKey
    
            vk = VerifyKey(base64.b64decode(pub_key_b64))
            sig_bytes = base64.b64decode(signature)
            vk.verify(content.encode(), sig_bytes)
            return {"verified": True, "did": did, "content": content}
        except ImportError:
            try:
                from cryptography.hazmat.primitives.asymmetric.ed25519 import (
                    Ed25519PublicKey,
                )
    
                pk = Ed25519PublicKey.from_public_bytes(base64.b64decode(pub_key_b64))
                pk.verify(base64.b64decode(signature), content.encode())
                return {"verified": True, "did": did, "content": content}
            except ImportError:
                return {"verified": False, "error": "No crypto library available (install pynacl or cryptography)"}
        except Exception as e:
            return {"verified": False, "error": str(e)}
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool verifies signatures but doesn't describe what happens on success/failure (e.g., returns boolean, throws error), performance characteristics, rate limits, or authentication needs. For a cryptographic tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 front-loaded with the core purpose in the first sentence, followed by a structured Args section that efficiently explains each parameter. Every sentence earns its place with no redundant or verbose language, making it appropriately sized and easy to parse.

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 (cryptographic verification), no annotations, no output schema, and 3 parameters, the description is minimally adequate. It covers the purpose and parameters well but lacks behavioral details (e.g., return values, error conditions) and usage context. It meets basic needs but leaves gaps that could hinder effective tool selection and invocation.

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%, so the description must compensate. It adds clear meaning for all three parameters: 'content' is 'the original content that was signed', 'signature' is 'the base64-encoded signature to verify', and 'did' is 'the DID of the agent who allegedly signed it'. This effectively documents parameter purposes beyond the bare schema, though it doesn't specify format constraints (e.g., DID syntax).

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 tool's purpose with a specific verb ('verify') and resource ('cryptographic signature against a DID's public key'), distinguishing it from siblings like aip_sign (which creates signatures) and aip_verify (which may have different verification scope). It precisely defines what the tool does without being vague or tautological.

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 like aip_verify or aip_check_messages. It lacks context about prerequisites, scenarios where verification is needed, or any explicit exclusions. Usage is implied only by the purpose statement, with no comparative information.

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/The-Nexus-Guard/aip-mcp-server'

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