Skip to main content
Glama
AnuragRai017

Python Docs Server

get_python_docs

Retrieve Python documentation by searching with natural language queries to find relevant programming information and code examples.

Instructions

Get Python documentation for a given query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query for Python documentation

Implementation Reference

  • Handler function for CallToolRequestSchema that specifically handles 'get_python_docs' by validating args, calling brave-search web search tool with python documentation query, and returning formatted results or errors.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      if (request.params.name !== 'get_python_docs') {
        throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${request.params.name}`);
      }
    
      if (!isValidGetPythonDocsArgs(request.params.arguments)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid arguments');
      }
    
      const query = request.params.arguments.query;
    
      try {
        const searchResult = await (server as any).callMcpTool({
            serverName: 'brave-search',
            toolName: 'search_web',
            arguments: {
              query: `python documentation ${query}`,
              count: 3,
            },
          });
    
        if (searchResult.isError) {
            return {
                content: [{
                    type: 'text',
                    text: `Error searching for documentation: ${searchResult.content[0].text}`
                }],
                isError: true,
            }
        }
    
        const results = searchResult.content[0].text;
    
        return {
          content: [
            {
              type: 'text',
              text: `Search results for "${query}":\n${results}`,
            },
          ],
        };
      } catch (error: any) {
        return {
            content: [{
                type: 'text',
                text: `Error: ${error.message}`
            }],
            isError: true,
        }
      }
    });
  • src/index.ts:27-44 (registration)
    Registration of the 'get_python_docs' tool in the ListToolsRequestHandler, including name, description, and input schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'get_python_docs',
          description: 'Get Python documentation for a given query',
          inputSchema: {
            type: 'object',
            properties: {
              query: {
                type: 'string',
                description: 'The search query for Python documentation',
              },
            },
            required: ['query'],
          },
        },
      ],
    }));
  • Type guard function for validating arguments to 'get_python_docs' tool, ensuring it has a 'query' string.
    const isValidGetPythonDocsArgs = (args: any): args is { query: string } =>
      typeof args === 'object' && args !== null && typeof args.query === 'string';
  • JSON schema definition for the input of 'get_python_docs' tool.
    inputSchema: {
      type: 'object',
      properties: {
        query: {
          type: 'string',
          description: 'The search query for Python documentation',
        },
      },
      required: ['query'],
    },
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 but offers minimal information. It mentions 'Get Python documentation' but doesn't specify aspects like data sources, rate limits, authentication needs, or response formats, leaving 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 extremely concise and front-loaded, consisting of a single, clear sentence that directly states the tool's function without any unnecessary words or structural fluff.

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 for effective tool use. It fails to address key contextual elements like the source of documentation, result format, or any operational constraints, making it insufficient despite the simple parameter schema.

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 single parameter 'query' fully documented in the schema. The description adds no additional meaning beyond what the schema provides, such as query examples or format details, so it meets the baseline for adequate but unenriched parameter information.

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 tool's purpose with a specific verb ('Get') and resource ('Python documentation'), and specifies the action is for a 'given query'. However, with no sibling tools mentioned, there's no opportunity to distinguish from alternatives, preventing 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 or any contextual prerequisites. It simply restates the basic functionality without indicating scenarios, limitations, or comparisons to other methods.

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/AnuragRai017/python-docs-server-MCP-Server'

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