Skip to main content
Glama

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(), },

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