Skip to main content
Glama

listConfigs

Find configuration files in your workspace by scanning for JSON, YAML, TOML, and other formats using customizable patterns to manage settings.

Instructions

List configuration files in the workspace matching specified patterns

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeNoGlob patterns for config files

Implementation Reference

  • The handler function for the 'listConfigs' tool. It calls the searchFiles helper with an empty query and listOnly: true to list configuration files matching the provided glob patterns.
    async ({ include }: { include: string[] }) => {
      try {
        const items = await searchFiles("", include, { listOnly: true, maxResults: 200 });
        return { content: items };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Error listing configs: ${error}` }],
          isError: true,
        };
      }
    }
  • Input schema for the 'listConfigs' tool, defining the optional 'include' parameter with default glob patterns for common config file extensions.
    {
      include: z
        .array(z.string())
        .default(["**/*.{json,jsonc,yaml,yml,toml}"])
        .describe("Glob patterns for config files"),
    },
  • src/index.ts:112-132 (registration)
    Registration of the 'listConfigs' tool using mcp.tool(), including name, description, input schema, and inline handler function.
    mcp.tool(
      "listConfigs",
      "List configuration files in the workspace matching specified patterns",
      {
        include: z
          .array(z.string())
          .default(["**/*.{json,jsonc,yaml,yml,toml}"])
          .describe("Glob patterns for config files"),
      },
      async ({ include }: { include: string[] }) => {
        try {
          const items = await searchFiles("", include, { listOnly: true, maxResults: 200 });
          return { content: items };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error listing configs: ${error}` }],
            isError: true,
          };
        }
      }
    );
  • The searchFiles helper function, crucial for listConfigs as it performs glob file searching and listing (when listOnly=true), filtering, and preview generation.
    export async function searchFiles(
      query: string,
      include: string[],
      options: SearchOptions = {}
    ): Promise<SearchResultItem[]> {
      const { maxResults = 100, listOnly = false } = options;
      const files = await fg(include, {
        dot: false,
        ignore: ["**/node_modules/**", "**/.git/**", "**/dist/**"],
        unique: true,
      });
    
      const results: SearchResultItem[] = [];
      for (const file of files) {
        if (listOnly) {
          results.push({ type: "text", text: file });
          if (results.length >= maxResults) break;
          continue;
        }
        try {
          const content = await fs.readFile(file, "utf8");
          if (!query || content.toLowerCase().includes(query.toLowerCase())) {
            const preview = content.slice(0, 2000);
            results.push({ type: "text", text: `# ${file}\n\n${preview}` });
          }
          if (results.length >= maxResults) break;
        } catch {
          // ignore unreadable files
        }
      }
      return results;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'list' and 'matching specified patterns', which implies a read-only operation, but doesn't disclose behavioral traits like whether it returns file contents or just names, pagination, rate limits, permissions required, or error conditions. The description is minimal and leaves key behaviors unspecified.

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?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized for a simple tool, with zero waste or redundancy.

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 tool's low complexity (1 optional parameter, no output schema, no annotations), the description is minimally adequate but incomplete. It covers the basic purpose but lacks details on usage context, behavioral traits, and output format, which are needed for effective agent use. The simplicity of the tool prevents a lower score, but gaps remain.

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 the parameter 'include' documented as 'Glob patterns for config files'. The description adds marginal value by mentioning 'specified patterns', which aligns with the schema but doesn't provide additional semantics like examples of patterns or how matching works. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate beyond the schema.

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 clearly states the action ('List') and resource ('configuration files in the workspace'), and specifies the scope ('matching specified patterns'). It distinguishes from 'getConfig' (likely retrieves a single config) and 'setConfig' (writes configs), but doesn't explicitly differentiate from 'searchDocs' or 'searchSettings' which might also list files. The purpose is specific but sibling differentiation is incomplete.

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?

The description provides no guidance on when to use this tool versus alternatives like 'searchDocs' or 'searchSettings', nor does it mention prerequisites or constraints. It implies usage when needing to list config files with patterns, but lacks explicit when/when-not instructions or named alternatives beyond what can be inferred from sibling names.

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/cloud-aspect/Config-MCP-Server'

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