Skip to main content
Glama

enable_doc

Enables crawling for a specified document, making its content searchable and indexed.

Instructions

Enable crawling for a specific doc

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the doc to enable

Implementation Reference

  • Handler for the 'enable_doc' tool: sets docConfig[name] to true, persists via saveDocConfig(), and returns a confirmation message.
    case "enable_doc": {
      const name = String(request.params.arguments?.name);
      docConfig[name] = true;
      await saveDocConfig();
      return {
        content: [{
          type: "text",
          text: `Enabled doc ${name}`
        }]
      };
    }
  • Tool registration and input schema for enable_doc in ListToolsRequestSchema handler.
    {
      name: "enable_doc",
      description: "Enable crawling for a specific doc",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Name of the doc to enable"
          }
        },
        required: ["name"]
      }
    },
  • src/index.ts:404-531 (registration)
    Registration of all tools including enable_doc via ListToolsRequestSchema handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: "enable_doc",
            description: "Enable crawling for a specific doc",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "Name of the doc to enable"
                }
              },
              required: ["name"]
            }
          },
          {
            name: "disable_doc",
            description: "Disable crawling for a specific doc",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "Name of the doc to disable"
                }
              },
              required: ["name"]
            }
          },
          {
            name: "crawl_docs",
            description: "Start crawling enabled docs",
            inputSchema: {
              type: "object",
              properties: {
                force: {
                  type: "boolean",
                  description: "Whether to force re-crawl all docs, ignoring previous crawl records"
                }
              }
            }
          },
          {
            name: "build_index",
            description: "Build search index for docs",
            inputSchema: {
              type: "object",
              properties: {
                force: {
                  type: "boolean",
                  description: "Whether to force rebuild index"
                }
              }
            }
          },
          {
            name: "search_docs",
            description: "Search documentation",
            inputSchema: {
              type: "object",
              properties: {
                query: {
                  type: "string",
                  description: "Search query"
                },
                max_results: {
                  type: "number",
                  description: "Maximum number of results",
                  default: 3
                },
                doc_name: {
                  type: "string",
                  description: "Filter by document category"
                },
                offset: {
                  type: "number",
                  description: "Number of results to skip",
                  default: 0
                }
              },
              required: ["query"]
            }
          },
          {
            name: "build_index",
            description: "Build search index for docs",
            inputSchema: {
              type: "object",
              properties: {
                force: {
                  type: "boolean",
                  description: "Whether to force rebuild index"
                }
              }
            }
          },
          {
            name: "list_enabled_docs",
            description: "List all enabled docs with their cache status",
            inputSchema: {
              type: "object",
              properties: {
                verbose: {
                  type: "boolean",
                  description: "Whether to show detailed information",
                  default: false
                }
              }
            }
          },
          {
            name: "list_all_docs",
            description: "List all available docs including disabled ones",
            inputSchema: {
              type: "object",
              properties: {
                verbose: {
                  type: "boolean",
                  description: "Whether to show detailed information",
                  default: false
                }
              }
            }
          }
        ]
      };
  • Helper function called by enable_doc handler to persist the updated docConfig to disk.
    async function saveDocConfig(): Promise<void> {
      try {
        const config = {
          enabledDocs: docConfig,
          crawledDocs: {}
        };
        if (await fs.pathExists(configPath)) {
          const existingConfig = await fs.readJson(configPath);
          config.crawledDocs = existingConfig.crawledDocs || {};
        }
        await fs.ensureDir(docDir);
        await fs.writeJson(configPath, config, { spaces: 2 });
      } catch (error) {
        console.error('Failed to save doc config:', error);
      }
    }
Behavior2/5

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

No annotations provided, so description must carry full burden. It only says 'enable crawling' without disclosing whether action is reversible, triggers immediate crawling, or requires special permissions. Minimal behavioral insight.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence, no unnecessary words, but it lacks substance. Conciseness is adequate but the description is too minimal to be fully helpful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple 1-param tool with no output schema, the description is barely adequate. Does not explain the effect on the doc or relationship to siblings like 'disable_doc' or 'list_enabled_docs'.

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 coverage is 100% with a clear description for the only parameter 'name'. The tool description adds no extra meaning beyond the schema; baseline 3 is appropriate as schema does the work.

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 'Enable crawling for a specific doc' clearly states the action (enable) and resource (doc for crawling). It distinguishes from sibling 'disable_doc' by targeting enablement, but does not explain what 'crawling' entails in this context.

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?

No guidance on when to use this tool versus alternatives like 'crawl_docs' or 'disable_doc'. Missing prerequisites or conditions (e.g., doc must exist, must be disabled first). Usage is implied but not explicit.

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/askme765cs/open-docs-mcp'

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