Skip to main content
Glama

list_cached_repositories

Retrieve all GitHub repositories with documentation currently stored in cache for quick access to repository information through natural language queries.

Instructions

List all repositories currently cached

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'list_cached_repositories' tool call. It invokes cacheManager.listRepositories() and returns the result as JSON-formatted text content.
    case 'list_cached_repositories': {
      const repos = await cacheManager.listRepositories();
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(repos, null, 2),
          },
        ],
      };
    }
  • src/server.ts:100-107 (registration)
    Registration of the 'list_cached_repositories' tool in the ListTools response, including name, description, and input schema.
    {
      name: 'list_cached_repositories',
      description: 'List all repositories currently cached',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Input schema for the 'list_cached_repositories' tool, which requires no parameters.
    inputSchema: {
      type: 'object',
      properties: {},
    },
  • Core implementation of listing cached repositories. Scans memory cache and disk cache files, filters by TTL, collects repo info, cleans expired entries, and sorts by lastUpdated.
    async listRepositories(): Promise<Array<{ owner: string; repo: string; lastUpdated: Date; size: number }>> {
      const repositories: Array<{ owner: string; repo: string; lastUpdated: Date; size: number }> = [];
    
      // Check memory cache
      for (const [key, entry] of this.memoryCache.entries()) {
        if (Date.now() - entry.timestamp < entry.ttl) {
          const [owner, repo] = key.split('/');
          if (owner && repo) {
            repositories.push({
              owner,
              repo,
              lastUpdated: entry.docs.lastUpdated,
              size: entry.docs.metadata.size,
            });
          }
        }
      }
    
      // Check disk cache
      try {
        const files = await fs.readdir(this.cacheDir);
        for (const file of files) {
          if (file.endsWith('.json')) {
            try {
              const filePath = path.join(this.cacheDir, file);
              const data = await fs.readFile(filePath, 'utf-8');
              const entry: CacheEntry = JSON.parse(data);
              
              if (Date.now() - entry.timestamp < entry.ttl) {
                const [owner, repo] = file.replace('.json', '').split('_');
                if (owner && repo) {
                  repositories.push({
                    owner,
                    repo,
                    lastUpdated: entry.docs.lastUpdated,
                    size: entry.docs.metadata.size,
                  });
                }
              } else {
                // Expired, remove it
                await fs.unlink(filePath).catch(() => {});
              }
            } catch {
              // Skip corrupted cache files
            }
          }
        }
      } catch {
        // Cache directory doesn't exist or can't be read
      }
    
      return repositories.sort((a, b) => b.lastUpdated.getTime() - a.lastUpdated.getTime());
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but reveals nothing about permissions needed, rate limits, response format, pagination, or whether the operation is idempotent. For a tool with zero annotation coverage, this is insufficient behavioral context.

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 communicates the core purpose without any wasted words. It's appropriately sized for a simple list operation and front-loads the essential information immediately.

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?

For a zero-parameter tool with no output schema, the description provides the minimum viable information about what the tool does. However, it lacks important context about the response format, caching behavior implications, and how this differs from sibling search tools, leaving gaps in overall completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters with 100% schema description coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a baseline score of 4 for correctly handling this parameterless scenario.

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 target resource ('repositories currently cached'), making the purpose immediately understandable. It doesn't distinguish from sibling tools like 'get_repository_docs' or 'search_repository', but the verb+resource combination is specific enough for basic understanding.

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 'search_repository' or 'get_repository_docs'. There's no mention of prerequisites, timing considerations, or comparison with sibling tools, leaving the agent to infer usage context independently.

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/cbuntingde/codewiki-mcp-server'

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