Skip to main content
Glama

get_trust_evidence

Provides trust evidence package with chain statistics, anchor counts, and verification result for evaluating agent trustworthiness.

Instructions

Return structured trust evidence for this agent.

Provides a comprehensive trust evidence package including Chain of Consciousness
statistics, anchor counts, latest hash, verification status, and protocol
information. This data can be used by other agents to assess trustworthiness.

No arguments required — reads from the local chain.

Returns:
    JSON with chain stats, anchor data, verification result, and protocol metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for get_trust_evidence. Decorated with @mcp.tool(). Returns a JSON string with chain stats, anchoring data, identity, verification endpoints, and protocol metadata. Reads the chain file via _read_chain(), verifies integrity via _verify_chain(), counts OTS/TSA anchor proofs, and calculates chain age. Returns a 'no_chain' status if no chain exists.
    @mcp.tool()
    def get_trust_evidence() -> str:
        """Return structured trust evidence for this agent.
    
        Provides a comprehensive trust evidence package including Chain of Consciousness
        statistics, anchor counts, latest hash, verification status, and protocol
        information. This data can be used by other agents to assess trustworthiness.
    
        No arguments required — reads from the local chain.
    
        Returns:
            JSON with chain stats, anchor data, verification result, and protocol metadata
        """
        chain = _read_chain()
    
        if not chain:
            return json.dumps({
                "status": "no_chain",
                "message": "No Chain of Consciousness initialized. Call coc_init first.",
                "trust_level": "none",
            })
    
        report = _verify_chain(chain)
    
        # Count anchor proofs
        anchor_dir = os.path.join(CHAIN_DIR, "anchors")
        ots_count = 0
        tsa_count = 0
        if os.path.isdir(anchor_dir):
            for f in os.listdir(anchor_dir):
                if f.endswith(".ots"):
                    ots_count += 1
                elif f.endswith(".tsr"):
                    tsa_count += 1
    
        # Calculate chain age in days
        chain_age_days = 0
        if chain:
            try:
                genesis_dt = datetime.fromisoformat(chain[0]["ts"])
                now = datetime.now(timezone.utc)
                chain_age_days = (now - genesis_dt).days
            except (ValueError, KeyError):
                pass
    
        evidence = {
            "status": "active",
            "trust_level": "verified" if report["is_valid"] else "unverified",
            "chain": {
                "length": len(chain),
                "age_days": chain_age_days,
                "genesis_timestamp": chain[0]["ts"] if chain else None,
                "latest_timestamp": chain[-1]["ts"] if chain else None,
                "genesis_hash": chain[0]["entry_hash"] if chain else None,
                "head_hash": chain[-1]["entry_hash"] if chain else None,
                "schema_version": SCHEMA_VERSION,
                "integrity_verified": report["is_valid"],
                "verification_error": report.get("error"),
                "agents": report.get("agents", {}),
                "event_types": report.get("types", {}),
                "session_bridges": report.get("session_bridges", 0),
                "session_mismatches": report.get("session_mismatches", 0),
            },
            "anchoring": {
                "chain_anchor_events": len(report.get("anchors", [])),
                "ots_proofs": ots_count,
                "tsa_proofs": tsa_count,
                "anchor_types": ["OpenTimestamps/Bitcoin", "RFC3161/TSA"],
                "latest_anchor": report["anchors"][-1] if report.get("anchors") else None,
            },
            "identity": {
                "did": "did:web:vibeagentmaking.com",
                "agent_card": "https://vibeagentmaking.com/.well-known/agent-card.json",
                "did_document": "https://vibeagentmaking.com/.well-known/did.json",
            },
            "verification_endpoints": {
                "chain_data": "https://vibeagentmaking.com/chain/chain.jsonl",
                "chain_verify": "https://vibeagentmaking.com/verify/",
                "anchor_proofs": "https://vibeagentmaking.com/chain/anchors/",
            },
            "protocols": {
                "name": "Agent Trust Stack",
                "website": "https://vibeagentmaking.com",
                "count": 7,
                "mcp_server": "pip install agent-trust-stack-mcp",
                "full_stack": "pip install agent-trust-stack",
            },
        }
    
        return json.dumps(evidence)
  • The tool is registered via the @mcp.tool() decorator on line 1119, where 'mcp' is a FastMCP instance created on line 53.
    @mcp.tool()
  • Helper function called by get_trust_evidence to read the chain from the JSONL file.
    def _read_chain() -> list:
        if not os.path.exists(CHAIN_FILE):
            return []
        entries = []
        with open(CHAIN_FILE, "r", encoding="utf-8") as f:
            for line in f:
                line = line.strip()
                if line:
                    entries.append(json.loads(line))
        return entries
  • Helper function called by get_trust_evidence to verify chain integrity (hash linkage, sequence, data hashes).
    def _verify_chain(chain: list) -> dict:
        report = {
            "is_valid": False,
            "error": None,
            "genesis_ts": None,
            "latest_ts": None,
            "entry_count": len(chain),
            "agents": {},
            "types": {},
            "anchors": [],
            "session_bridges": 0,
            "session_mismatches": 0,
            "schema_versions": {},
        }
        if not chain:
            report["error"] = "Chain is empty"
            return report
    
        if chain[0]["type"] != "genesis":
            report["error"] = f"Entry 0 is not genesis (type={chain[0]['type']})"
            return report
        if chain[0]["prev_hash"] != "0" * 64:
            report["error"] = "Genesis prev_hash is not zeros"
            return report
    
        report["genesis_ts"] = chain[0]["ts"]
    
        for i, entry in enumerate(chain):
            if entry["seq"] != i:
                report["error"] = f"Entry {i}: sequence mismatch (expected {i}, got {entry['seq']})"
                return report
            expected_data_hash = _sha256(entry["data"])
            if entry["data_hash"] != expected_data_hash:
                report["error"] = f"Entry {i}: data_hash mismatch"
                return report
            if i > 0 and entry["prev_hash"] != chain[i - 1]["entry_hash"]:
                report["error"] = f"Entry {i}: prev_hash doesn't match entry {i-1} hash"
                return report
            payload = f"{entry['seq']}|{entry['ts']}|{entry['type']}|{entry['agent']}|{entry['data_hash']}|{entry['prev_hash']}"
            expected_hash = _sha256(payload)
            if entry["entry_hash"] != expected_hash:
                report["error"] = f"Entry {i}: entry_hash mismatch"
                return report
    
            etype = entry["type"]
            report["types"][etype] = report["types"].get(etype, 0) + 1
            agent = entry["agent"]
            report["agents"][agent] = report["agents"].get(agent, 0) + 1
            if etype == "anchor":
                report["anchors"].append(entry["ts"])
            sv = entry.get("schema_version", "1.0")
            if sv not in report["schema_versions"]:
                report["schema_versions"][sv] = {"first": i, "last": i}
            else:
                report["schema_versions"][sv]["last"] = i
            if etype == "session_start" and entry.get("verification"):
                report["session_bridges"] += 1
                if entry.get("commitment_match") is False:
                    report["session_mismatches"] += 1
    
        report["latest_ts"] = chain[-1]["ts"]
        report["is_valid"] = True
        return report
Behavior3/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. It reveals that the tool requires no arguments, reads from the local chain, and returns a JSON package. However, it does not disclose any side effects, performance implications, or safety guarantees beyond the obvious read operation. This is sufficient for a simple tool but could be improved.

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 concise and well-structured: a one-line summary, an explanatory paragraph, a clear note about no arguments, and a returns section. Every sentence serves a purpose without redundancy.

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

Completeness5/5

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

Given the tool's simplicity (no parameters, output schema present), the description is complete. It covers purpose, return structure, and invocation details. The output schema handles return value specifics, so no additional detail is needed.

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?

The input schema has zero parameters, so the baseline is 4. The description adds no parameter details (none needed) and appropriately states 'No arguments required'.

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 returns structured trust evidence for the agent, specifying the verb 'Return' and resource 'trust evidence'. It lists included components (Chain of Consciousness statistics, anchor counts, etc.), and distinguishes from siblings like coc_* (which focus on specific chain operations) and trust_stack_info (which might be similar but this is agent-specific).

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?

The description provides context for when to use the tool: to obtain a trust evidence package for assessing trustworthiness of agents. It does not explicitly state when not to use or suggest alternatives, but with zero parameters and a clear purpose, this is adequate.

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/alexfleetcommander/agent-trust-stack-mcp'

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