Skip to main content
Glama

enable_doc

Activate crawling for a specific document to make its content searchable and accessible within the document management system.

Instructions

Enable crawling for a specific doc

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the doc to enable

Implementation Reference

  • The handler for the 'enable_doc' tool. It extracts the doc name from arguments, sets it as enabled in the global docConfig, saves the config to file, and returns a success message.
    case "enable_doc": { const name = String(request.params.arguments?.name); docConfig[name] = true; await saveDocConfig(); return { content: [{ type: "text", text: `Enabled doc ${name}` }] }; }
  • src/index.ts:407-420 (registration)
    Registration of the 'enable_doc' tool in the ListToolsRequestSchema handler. Includes the tool name, description, and input schema definition requiring a 'name' string.
    { 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"] } },
  • Input schema for the 'enable_doc' tool, defining an object with a required 'name' string property.
    inputSchema: { type: "object", properties: { name: { type: "string", description: "Name of the doc to enable" } }, required: ["name"]
  • Helper function called by the enable_doc handler to persist the updated docConfig to the JSON config file, preserving existing crawledDocs data.
    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); } }

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