Skip to main content
Glama
dasein108

Cyb MCP Server

by dasein108

sendCyberlink

Create connections between IPFS content identifiers on the Cyber network to establish semantic relationships in the decentralized knowledge graph.

Instructions

Create a cyberlink between two IPFS CIDs on the Cyber network

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromYesSource CID or text (will be converted to CID if not a valid CID)
toYesTarget CID or text (will be converted to CID if not a valid CID)
feeNoTransaction fee (optional)

Implementation Reference

  • The core implementation of the sendCyberlink tool. Handles input validation, CID conversion, wallet signing, and transaction submission via the CyberClient's cyberlink method.
    private async handleSendCyberlink(args: { from: string; to: string; fee?: any; }) { try { // Check if wallet is initialized if (!this.wallet.isInitialized()) { return { content: [ { type: 'text', text: 'Error: No mnemonic provided. The sendCyberlink tool requires a wallet to sign transactions. Please provide CYBER_MNEMONIC in your environment variables.', }, ], isError: true, }; } // Convert to CIDs if necessary const fromCid = isValidCID(args.from) ? args.from : await getIpfsHash(args.from); const toCid = isValidCID(args.to) ? args.to : await getIpfsHash(args.to); const signingClient = this.wallet.getSigningClient(); const address = this.wallet.getAddress(); const fee = args.fee || { amount: [{ denom: BASE_DENOM, amount: '0' }], gas: '200000', }; const result = await signingClient.cyberlink( address, fromCid, toCid, fee ); return { content: [ { type: 'text', text: `Cyberlink created successfully!\nTransaction Hash: ${Array.isArray(result) ? 'Multiple transactions' : (result as any).transactionHash || 'Unknown'}\nFrom: ${fromCid}\nTo: ${toCid}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error creating cyberlink: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
  • Input schema for the sendCyberlink tool, specifying required 'from' and 'to' CIDs/texts and optional fee structure.
    inputSchema: { type: 'object', properties: { from: { type: 'string', description: 'Source CID or text (will be converted to CID if not a valid CID)', }, to: { type: 'string', description: 'Target CID or text (will be converted to CID if not a valid CID)', }, fee: { type: 'object', description: 'Transaction fee (optional)', properties: { amount: { type: 'array', items: { type: 'object', properties: { denom: { type: 'string' }, amount: { type: 'string' }, }, }, }, gas: { type: 'string' }, }, default: { amount: [{ denom: BASE_DENOM, amount: '0' }], gas: '200000', }, }, }, required: ['from', 'to'], },
  • src/index.ts:50-88 (registration)
    Registration of the sendCyberlink tool in the listTools handler, providing name, description, and input schema.
    { name: 'sendCyberlink', description: 'Create a cyberlink between two IPFS CIDs on the Cyber network', inputSchema: { type: 'object', properties: { from: { type: 'string', description: 'Source CID or text (will be converted to CID if not a valid CID)', }, to: { type: 'string', description: 'Target CID or text (will be converted to CID if not a valid CID)', }, fee: { type: 'object', description: 'Transaction fee (optional)', properties: { amount: { type: 'array', items: { type: 'object', properties: { denom: { type: 'string' }, amount: { type: 'string' }, }, }, }, gas: { type: 'string' }, }, default: { amount: [{ denom: BASE_DENOM, amount: '0' }], gas: '200000', }, }, }, required: ['from', 'to'], }, },
  • src/index.ts:140-141 (registration)
    Dispatch registration in the CallToolRequestSchema handler, routing 'sendCyberlink' calls to the handler function.
    case 'sendCyberlink': return await this.handleSendCyberlink(args as any);
  • Configuration interface noting that mnemonic is required specifically for the sendCyberlink tool.
    mnemonic?: string; // Optional - only needed for sendCyberlink

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/dasein108/cyb-mcp'

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