Skip to main content
Glama

list_files

Retrieve all files within an Overleaf project, optionally filtered by file extension. Specify project name or ID to access and manage project content efficiently via Git integration.

Instructions

List all files in an Overleaf project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
extensionNoFile extension filter (e.g., .tex).tex
gitTokenNoGit token (optional, uses env var)
projectIdNoProject ID (optional, uses env var)
projectNameNoProject name (default, project2, etc.)

Implementation Reference

  • Handler logic for the 'list_files' tool that retrieves the project client and lists files filtered by extension.
    case 'list_files': {
      const client = getProject(args.projectName);
      const files = await client.listFiles(args.extension || '.tex');
      return {
        content: [
          {
            type: 'text',
            text: files.join('\n'),
          },
        ],
      };
    }
  • Tool registration entry listing the 'list_files' tool with description and input schema in the MCP server's tool list.
    {
      name: 'list_files',
      description: 'List files in an Overleaf project',
      inputSchema: {
        type: 'object',
        properties: {
          projectName: {
            type: 'string',
            description: 'Project identifier (optional, defaults to "default")',
          },
          extension: {
            type: 'string',
            description: 'File extension filter (optional, e.g., ".tex")',
          },
        },
      },
    },
  • Input schema defining parameters for the 'list_files' tool: optional projectName and extension.
    inputSchema: {
      type: 'object',
      properties: {
        projectName: {
          type: 'string',
          description: 'Project identifier (optional, defaults to "default")',
        },
        extension: {
          type: 'string',
          description: 'File extension filter (optional, e.g., ".tex")',
        },
      },
    },
  • Implementation of listFiles method in OverleafGitClient class that clones/pulls the repository and uses 'find' command to list matching files.
    async listFiles(extension = '.tex') {
      await this.cloneOrPull();
      const { stdout } = await exec(
        `find "${this.repoPath}" -name "*${extension}" -type f`
      );
      return stdout
        .split('\n')
        .filter(f => f)
        .map(f => f.replace(this.repoPath + '/', ''));
    }
  • Helper function to create an OverleafGitClient instance for a given project name from configuration.
    function getProject(projectName = 'default') {
      const project = projectsConfig.projects[projectName];
      if (!project) {
        throw new Error(`Project "${projectName}" not found in configuration`);
      }
      return new OverleafGitClient(project.projectId, project.gitToken);
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without disclosing behavioral traits. It doesn't mention whether this is a read-only operation, what permissions are needed, how results are formatted, or any rate limits, which is insufficient for a tool with 4 parameters.

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 states the core purpose without any wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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

Completeness2/5

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

Given 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain return values, error conditions, or behavioral context needed for effective use, leaving significant gaps despite the concise statement of purpose.

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%, so the schema already documents all parameters thoroughly. The description adds no additional meaning about parameters beyond implying a listing operation, meeting the baseline score when schema does the heavy lifting.

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 verb 'List' and resource 'files in an Overleaf project', making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_projects' or 'get_sections', which would require explicit comparison to achieve a score of 5.

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 'list_projects' or 'get_sections'. There's no mention of prerequisites, context, or exclusions, leaving the agent without usage direction.

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

Related 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/mjyoo2/OverleafMCP'

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