Skip to main content
Glama

sign_certificate

sign_certificate

Create and sign canonical certificates for identification, attestation, or verification purposes on the VeChain blockchain. Specify domain, payload, and expiration to generate verifiable certificates.

Instructions

Create and sign a canonical certificate. Includes purpose, payload, domain, timestamp, nonce, and expiresAt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
purposeNoidentification
payloadNoContent to be attested (string or JSON)
domainYesScope or domain where it is valid
timestampNo

Implementation Reference

  • src/tools.ts:519-567 (registration)
    Registration of the 'sign_certificate' tool in the vechainTools array. Includes name, description, input schema, and inline callback handler.
    {
        name: "sign_certificate",
        title: "Sign certificate",
        description: "Create and sign a canonical certificate. Includes purpose, payload, domain, timestamp, nonce, and expiresAt.",
        inputSchema: {
            purpose: z.enum(["identification", "attestation", "verification"]).default("identification"),
            payload: z.any().describe("Content to be attested (string or JSON)"),
            domain: z.string().min(1).describe("Scope or domain where it is valid"),
            timestamp: z.number().int().positive().optional(),
        },
        callback: async ({
            purpose,
            payload,
            domain,
            timestamp = Math.floor(Date.now() / 1000),
        }: {
            purpose: "identification" | "attestation" | "verification",
            payload: any,
            domain: string,
            timestamp?: number
        }) => {
            const secretKey = process.env.AGENT_SECRET_KEY
    
            if (!secretKey) {
                throw new Error("Missing AGENT_SECRET_KEY variable to use this tool.")
            }
    
            const secretKeyBytes = Address.of(secretKey).bytes
            const publicKey = Secp256k1.derivePublicKey(secretKeyBytes);
            const publicKeyAddress = Address.ofPublicKey(publicKey).toString();
    
            const certificate = Certificate.of({
                purpose,
                payload,
                timestamp,
                domain,
                signer: publicKeyAddress
            })
    
            const signature = certificate.sign(secretKeyBytes);
    
            return {
                content: [{
                    type: "text",
                    text: JSON.stringify(signature, null, 2)
                }]
            };
        }
    },
  • The handler callback that implements the tool logic: retrieves agent secret key from environment, derives public key and address, creates a Certificate object, signs it, and returns the signature as JSON.
    callback: async ({
        purpose,
        payload,
        domain,
        timestamp = Math.floor(Date.now() / 1000),
    }: {
        purpose: "identification" | "attestation" | "verification",
        payload: any,
        domain: string,
        timestamp?: number
    }) => {
        const secretKey = process.env.AGENT_SECRET_KEY
    
        if (!secretKey) {
            throw new Error("Missing AGENT_SECRET_KEY variable to use this tool.")
        }
    
        const secretKeyBytes = Address.of(secretKey).bytes
        const publicKey = Secp256k1.derivePublicKey(secretKeyBytes);
        const publicKeyAddress = Address.ofPublicKey(publicKey).toString();
    
        const certificate = Certificate.of({
            purpose,
            payload,
            timestamp,
            domain,
            signer: publicKeyAddress
        })
    
        const signature = certificate.sign(secretKeyBytes);
    
        return {
            content: [{
                type: "text",
                text: JSON.stringify(signature, null, 2)
            }]
        };
    }
  • Zod input schema defining the parameters: purpose (enum), payload (any), domain (string), timestamp (optional number).
    inputSchema: {
        purpose: z.enum(["identification", "attestation", "verification"]).default("identification"),
        payload: z.any().describe("Content to be attested (string or JSON)"),
        domain: z.string().min(1).describe("Scope or domain where it is valid"),
        timestamp: z.number().int().positive().optional(),
    },
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. While 'Create and sign' implies a write/mutation operation, it doesn't specify whether this requires authentication, what permissions are needed, if it's idempotent, or what happens on failure. The description mentions 'expiresAt' as included in the certificate, but this isn't in the input schema, creating confusion rather than clarity about behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('Create and sign a canonical certificate') and then lists components. There's no wasted verbiage, and it's appropriately sized for the tool's complexity. However, the inclusion of 'nonce' and 'expiresAt' not in the schema slightly reduces clarity without adding value.

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

Completeness2/5

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

Given no annotations, no output schema, and only 50% schema description coverage, the description is incomplete for a tool that performs a write operation (signing). It lacks details on authentication requirements, error handling, return values, or how the signed certificate is delivered. The mention of 'nonce' and 'expiresAt' not in the schema adds confusion rather than completeness.

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

Parameters3/5

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

Schema description coverage is 50% (2 out of 4 parameters have descriptions). The description lists 'purpose, payload, domain, timestamp, nonce, and expiresAt' as included, but only 'purpose', 'payload', 'domain', and 'timestamp' are in the schema, with 'nonce' and 'expiresAt' missing. This adds some semantic context for the parameters that exist but introduces inconsistency. The description compensates partially for the schema's gaps but not fully.

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 action ('Create and sign') and the resource ('canonical certificate'), making the purpose understandable. It also lists key components included in the certificate, which adds specificity. However, it doesn't explicitly differentiate this tool from sibling tools like 'sign_message' or 'sign_typed_data_evm', which prevents a perfect score.

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. With sibling tools like 'sign_message' and 'sign_typed_data_evm' that also involve signing operations, there's no indication of what distinguishes this certificate signing from those other signing operations. No prerequisites, exclusions, or context for usage are mentioned.

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/leandrogavidia/vechain-mcp-server'

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