Skip to main content
Glama
Particle-Academy

@particle-academy/docs-mcp

Official

docs_list

List all available documentation files from installed @particle-academy packages. Optionally filter by package name to narrow results.

Instructions

List doc file paths. Each entry is the path you pass to docs_read. Optionally filter to one package.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageNoPackage name (e.g. '@particle-academy/react-fancy'). Omit to list all.

Implementation Reference

  • The handler function for the 'docs_list' tool. It filters the cached scan results by an optional 'package' argument, then returns a formatted list of doc file paths with package name, version, path, and byte size.
    (args) => {
      const pkgFilter = typeof args.package === "string" ? args.package : undefined;
      const filtered = pkgFilter ? cache.filter((p) => p.name === pkgFilter) : cache;
      if (filtered.length === 0) {
        return errorResult(
          pkgFilter
            ? `No docs found for package '${pkgFilter}'. Call docs_list_packages to see available packages.`
            : "No docs found.",
        );
      }
      const rows = filtered.flatMap((p) =>
        p.files.map((f) => ({
          package: p.name,
          version: p.version,
          path: f.path,
          bytes: f.bytes,
        })),
      );
      const lines = rows.map((r) => `${r.package}@${r.version}  ${r.path}  (${r.bytes}B)`);
      return textResult(lines.join("\n"), rows as unknown as JsonObject[]);
    },
  • The input schema for 'docs_list'. Defines a single optional 'package' string property that filters results to a specific package.
    inputSchema: {
      type: "object",
      properties: {
        package: {
          type: "string",
          description: "Package name (e.g. '@particle-academy/react-fancy'). Omit to list all.",
        },
      },
    },
  • src/tools.ts:50-86 (registration)
    Registration of the 'docs_list' tool via server.registerTool(), linking its name, description, inputSchema, and handler function.
    server.registerTool(
      {
        name: "docs_list",
        description:
          "List doc file paths. Each entry is the path you pass to docs_read. Optionally filter to one package.",
        inputSchema: {
          type: "object",
          properties: {
            package: {
              type: "string",
              description: "Package name (e.g. '@particle-academy/react-fancy'). Omit to list all.",
            },
          },
        },
      },
      (args) => {
        const pkgFilter = typeof args.package === "string" ? args.package : undefined;
        const filtered = pkgFilter ? cache.filter((p) => p.name === pkgFilter) : cache;
        if (filtered.length === 0) {
          return errorResult(
            pkgFilter
              ? `No docs found for package '${pkgFilter}'. Call docs_list_packages to see available packages.`
              : "No docs found.",
          );
        }
        const rows = filtered.flatMap((p) =>
          p.files.map((f) => ({
            package: p.name,
            version: p.version,
            path: f.path,
            bytes: f.bytes,
          })),
        );
        const lines = rows.map((r) => `${r.package}@${r.version}  ${r.path}  (${r.bytes}B)`);
        return textResult(lines.join("\n"), rows as unknown as JsonObject[]);
      },
    );
  • The scan() function in scanner.ts produces the PackageDocs[] cache that the docs_list handler reads from. It discovers packages with docs/ directories and README.md files.
    export function scan(opts: ScanOptions = {}): PackageDocs[] {
      const cwd = resolve(opts.cwd ?? process.cwd());
      const scopes = opts.scopes ?? DEFAULT_SCOPES;
      const allowName = (name: string) => {
        if (opts.packages && opts.packages.length > 0) {
          return opts.packages.includes(name);
        }
        if (scopes.length === 0) {
          return opts.includeUnscoped || name.startsWith("@");
        }
        if (name.startsWith("@")) {
          const scope = name.split("/")[0];
          return scopes.includes(scope);
        }
        return Boolean(opts.includeUnscoped);
      };
    
      const found = new Map<string, PackageDocs>();
    
      // Installed packages (node_modules)
      const nm = join(cwd, "node_modules");
      if (existsSync(nm)) {
        for (const dir of listPackageDirs(nm)) {
          if (!allowName(dir.name)) continue;
          const pkg = readPackage(dir.absolutePath, "node_modules");
          if (pkg) found.set(pkg.name, pkg);
        }
      }
    
      // Workspace packages (monorepo) — these win over node_modules with the
      // same name because in-tree docs are the source of truth during dev.
      if (opts.includeWorkspace !== false) {
        const pkgsRoot = join(cwd, "packages");
        if (existsSync(pkgsRoot)) {
          for (const entry of readdirSafe(pkgsRoot)) {
            const abs = join(pkgsRoot, entry);
            if (!isDir(abs)) continue;
            const pkgJsonPath = join(abs, "package.json");
            if (!existsSync(pkgJsonPath)) continue;
            const meta = readPackageJson(pkgJsonPath);
            if (!meta || !allowName(meta.name)) continue;
            const pkg = collectDocs(abs, meta.name, meta.version, "workspace");
            if (pkg) found.set(pkg.name, pkg);
          }
        }
      }
    
      return [...found.values()].sort((a, b) => a.name.localeCompare(b.name));
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It states the tool lists paths and filters by package, but does not disclose ordering, pagination, permissions, or error behavior. For a simple list tool, this is adequate but not richly transparent.

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?

Two concise sentences with no fluff. The first sentence front-loads the main action, and the second provides key context. Every word is necessary.

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

Completeness4/5

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

Given the tool's simplicity, the description is almost complete. It covers purpose, usage context, and parameter. The absence of output schema is acceptable as return format is implied (list of paths). Could mention output format but not critical.

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 description coverage is 100% with a clear description for the single parameter. The tool description adds 'Optionally filter to one package' which slightly reinforces the schema but does not provide additional semantic depth beyond what the schema already offers.

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 clearly states 'List doc file paths' and connects to the sibling tool docs_read, effectively specifying verb and resource. It distinguishes itself from siblings like docs_list_packages and docs_search by focusing on file paths.

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

Usage Guidelines4/5

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

The description provides clear context by indicating each entry is the path for docs_read, and optionally filters by package. However, it does not explicitly exclude alternatives or state when not to use this tool, so it lacks full when-not guidance.

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/Particle-Academy/docs-mcp'

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