Skip to main content
Glama
dasein108

Cyb MCP Server

by dasein108

getCyberlink

Retrieve content from IPFS by CID through the Cyber gateway to access decentralized information stored on the network.

Instructions

Retrieve content from IPFS by CID through the Cyber gateway

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidYesIPFS CID to retrieve content for

Implementation Reference

  • The primary handler function for the 'getCyberlink' tool. Validates the CID input and fetches the content from IPFS via the Cyber gateway using the retrieveContentByCID helper. Handles errors and formats the response.
    private async handleGetCyberlink(args: { cid: string }) {
      try {
        if (!isValidCID(args.cid)) {
          return {
            content: [
              {
                type: 'text',
                text: `Invalid CID format: ${args.cid}`,
              },
            ],
            isError: true,
          };
        }
    
        const contentItem = await this.retrieveContentByCID(args.cid);
        
        // Add CID info for text content
        if (contentItem.type === 'text' && contentItem.text && !contentItem.text.startsWith('Error')) {
          contentItem.text = `Content from CID: ${args.cid}\n\n${contentItem.text}`;
        }
    
        return {
          content: [contentItem],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error retrieving content for CID ${args.cid}: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema definition for the 'getCyberlink' tool, specifying a required 'cid' string parameter.
    inputSchema: {
      type: 'object',
      properties: {
        cid: {
          type: 'string',
          description: 'IPFS CID to retrieve content for',
        },
      },
      required: ['cid'],
    },
  • src/index.ts:118-131 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining name, description, and input schema.
    {
      name: 'getCyberlink',
      description: 'Retrieve content from IPFS by CID through the Cyber gateway',
      inputSchema: {
        type: 'object',
        properties: {
          cid: {
            type: 'string',
            description: 'IPFS CID to retrieve content for',
          },
        },
        required: ['cid'],
      },
    },
  • src/index.ts:144-145 (registration)
    Dispatch registration in the CallToolRequestSchema switch statement, routing calls to the handleGetCyberlink method.
    case 'getCyberlink':
      return await this.handleGetCyberlink(args as any);
  • Helper method used by getCyberlink to fetch and categorize content (text or image) from the Cyber gateway.
    private async retrieveContentByCID(cid: string): Promise<ContentItem> {
      try {
        const { content, mimeType, isImage } = await fetchContentFromGateway(
          this.config.cyberGateway,
          cid
        );
    
        if (isImage) {
          return {
            type: 'image',
            data: content, // base64 encoded image data
            mimeType,
          };
        } else {
          return {
            type: 'text',
            text: content,
          };
        }
      } catch (error) {
        return {
          type: 'text',
          text: `Error retrieving content: ${error instanceof Error ? error.message : String(error)}`,
        };
      }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves content but doesn't describe what 'retrieve' entails (e.g., read-only operation, potential rate limits, authentication needs, or what happens if the CID is invalid). This leaves significant gaps in understanding the tool's 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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with zero waste, making it easy for an agent to parse quickly.

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 the complexity of retrieving content from IPFS (which may involve network calls, error handling, or data formats), the description is incomplete. With no annotations, no output schema, and minimal behavioral context, it doesn't provide enough information for an agent to use the tool effectively beyond the basic parameter requirement.

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 100%, with the single parameter 'cid' documented as 'IPFS CID to retrieve content for'. The description adds no additional parameter semantics beyond what the schema provides, such as CID format examples or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Retrieve content') and target resource ('from IPFS by CID through the Cyber gateway'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'searchQuery' or 'sendCyberlink', which likely have different purposes (searching vs. sending content).

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 'searchQuery' or 'sendCyberlink'. It doesn't mention prerequisites, exclusions, or contextual factors that would help an agent choose between these tools, leaving usage decisions ambiguous.

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

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