Skip to main content
Glama

list_enabled_docs

Retrieve a list of all enabled documents along with their cache status to check availability and caching.

Instructions

List all enabled docs with their cache status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
verboseNoWhether to show detailed information

Implementation Reference

  • Handler for the 'list_enabled_docs' tool. Reads config, filters enabled docs, and returns their names along with cache status (verbose or compact).
    case "list_enabled_docs": {
      // Ensure config file exists before reading it
      await ensureConfigFile();
      
      const verbose = Boolean(request.params.arguments?.verbose);
      const config = await fs.readJson(configPath);
      const enabledDocs = docs.filter(doc => docConfig[doc.name]);
      
      const result = enabledDocs.map(doc => {
        const crawledAt = config.crawledDocs?.[doc.name] || "Not crawled";
        return verbose
          ? `${doc.name} (Enabled)\n  Start URL: ${doc.crawlerStart}\n  Last crawled: ${crawledAt}`
          : `${doc.name} [${crawledAt === "Not crawled" ? "Not cached" : "Cached"}]`;
      });
    
      return {
        content: [{
          type: "text",
          text: result.join("\n") || "No enabled docs found"
        }]
      };
    }
  • src/index.ts:503-515 (registration)
    Registration of the 'list_enabled_docs' tool in the ListToolsRequestSchema handler, defining its name, description, and input schema.
      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
          }
        }
      }
    },
  • Helper function called by the handler to ensure the config file exists before reading it.
    async function ensureConfigFile(): Promise<void> {
      try {
        if (!(await fs.pathExists(configPath))) {
          await fs.ensureDir(docDir);
          await fs.writeJson(configPath, {
            enabledDocs: {},
            crawledDocs: {}
          }, { spaces: 2 });
          console.log(`Created empty config file at ${configPath}`);
        }
      } catch (error) {
        console.error('Failed to create config file:', error);
      }
    }
  • Helper function that loads the doc config from the file into the global docConfig variable, used by the handler to determine which docs are enabled.
    async function loadDocConfig(): Promise<void> {
      try {
        // Ensure config file exists before trying to load it
        await ensureConfigFile();
        
        const config = await fs.readJson(configPath);
        docConfig = config.enabledDocs || {};
      } catch (error) {
        console.error('Failed to load doc config:', error);
        docConfig = {};
      }
    }
Behavior2/5

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

With no annotations, the description should disclose behavioral traits like read-only nature; it only states the function without additional context.

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

Conciseness4/5

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

The description is very concise and front-loaded, though it is a brief phrase rather than a full sentence; it is appropriately sized for the tool's simplicity.

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?

Given the simple tool (1 parameter, no output schema, no annotations), the description is adequate but lacks explicit contrast with sibling tools and behavioral details.

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% and the 'verbose' parameter is well-described in the schema; the description adds no extra meaning beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description specifies the verb 'List' and the resource 'enabled docs' and includes 'with their cache status', distinguishing it from sibling 'list_all_docs'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for fetching only enabled docs, but does not explicitly state when to use versus alternatives like 'list_all_docs'.

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