Skip to main content
Glama
aldrin-labs

solana-docs-mcp-server

by aldrin-labs

get_latest_docs

Retrieve specific Solana documentation sections such as "developing" or "running-validator" to access targeted technical content for development or validation tasks.

Instructions

Get latest Solana documentation sections

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sectionYesDocumentation section to fetch (e.g., "developing", "running-validator", "economics")

Implementation Reference

  • The main handler function for the 'get_latest_docs' tool. It validates the 'section' input, fetches the Solana docs page using axios, parses HTML with cheerio to extract title and content, truncates content, and returns a structured response or error.
    private async handleGetLatestDocs(args: any) {
      if (!args.section || typeof args.section !== 'string') {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid section parameter');
      }
    
      try {
        const response = await axios.get(`${this.baseDocsUrl}/${args.section}`);
        const $ = cheerio.load(response.data);
        
        const content = $('.markdown-section').text();
        const title = $('h1').first().text();
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                title,
                content: content.substring(0, 1000) + '...',  // Truncate for readability
                url: `${this.baseDocsUrl}/${args.section}`,
                timestamp: new Date().toISOString(),
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching docs: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema definition for the 'get_latest_docs' tool in the MCP server capabilities, specifying the required 'section' parameter.
    get_latest_docs: {
      name: 'get_latest_docs',
      description: 'Get latest Solana documentation sections',
      inputSchema: {
        type: 'object',
        properties: {
          section: {
            type: 'string',
            description: 'Documentation section to fetch (e.g., "developing", "running-validator", "economics")',
          },
        },
        required: ['section'],
      },
    },
  • src/index.ts:138-152 (registration)
    Registration of the tool handler via the CallToolRequestSchema dispatcher switch, which routes 'get_latest_docs' calls to handleGetLatestDocs.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      switch (request.params.name) {
        case 'get_latest_docs':
          return await this.handleGetLatestDocs(request.params.arguments);
        case 'search_docs':
          return await this.handleSearchDocs(request.params.arguments);
        case 'get_api_reference':
          return await this.handleGetApiReference(request.params.arguments);
        default:
          throw new McpError(
            ErrorCode.MethodNotFound,
            `Unknown tool: ${request.params.name}`
          );
      }
    });
  • src/index.ts:94-106 (registration)
    Tool metadata including schema returned by ListToolsRequestHandler.
      name: 'get_latest_docs',
      description: 'Get latest Solana documentation sections',
      inputSchema: {
        type: 'object',
        properties: {
          section: {
            type: 'string',
            description: 'Documentation section to fetch (e.g., "developing", "running-validator", "economics")',
          },
        },
        required: ['section'],
      },
    },
  • Core input schema for validating arguments to get_latest_docs.
      inputSchema: {
        type: 'object',
        properties: {
          section: {
            type: 'string',
            description: 'Documentation section to fetch (e.g., "developing", "running-validator", "economics")',
          },
        },
        required: ['section'],
      },
    },
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 fetches documentation but doesn't mention whether it's read-only, if it requires authentication, rate limits, or what the output format looks like. This leaves significant gaps for a tool that presumably interacts with external resources.

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 any wasted words. It's appropriately sized and front-loaded, making it easy 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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'latest' means (e.g., timestamp-based, version-specific), how results are returned, or error handling. For a tool with external dependencies, more context is needed to ensure reliable use.

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?

The schema description coverage is 100%, with the parameter 'section' clearly documented in the input schema. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline for adequate but not enhanced coverage.

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 ('Get') and resource ('latest Solana documentation sections'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_api_reference' or 'search_docs', which would be needed for 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 like 'get_api_reference' or 'search_docs'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent with minimal direction.

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

Related 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/aldrin-labs/solana-docs-mcp-server'

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