disable_doc
Stop web crawlers from indexing a specific document by disabling its crawling functionality.
Instructions
Disable crawling for a specific doc
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the doc to disable |
Implementation Reference
- src/index.ts:551-561 (handler)The handler logic for the 'disable_doc' tool. It takes the doc name from arguments, sets docConfig[name] = false to disable it, saves the config to file, and returns a success message.case "disable_doc": { const name = String(request.params.arguments?.name); docConfig[name] = false; await saveDocConfig(); return { content: [{ type: "text", text: `Disabled doc ${name}` }] }; }
- src/index.ts:422-434 (registration)The tool registration and schema definition for 'disable_doc' in the listTools response, specifying name, description, and input schema requiring a 'name' string.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"] } },
- src/index.ts:98-113 (helper)The saveDocConfig helper function called by disable_doc handler to persist the updated docConfig to docs-config.json file.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); } }