Skip to main content
Glama
snilld-ai

OpenAI Assistant MCP Server

by snilld-ai

list-files

Retrieve available files for OpenAI assistants to access and use in conversations or tasks.

Instructions

List files available for assistants

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler logic for the 'list-files' tool, which delegates to LLMConnector.list_files() and formats the list of files as text content.
    elif name == "list-files":
        response = await connector.list_files()
        files_str = "\\n".join([f"- ID: {f.id}, Name: {f.filename}, Size: {f.bytes} bytes" for f in response])
        if not files_str:
            files_str = "No files found."
        return [types.TextContent(type="text", text=f"Available Files:\\n{files_str}")]
  • The core implementation of listing OpenAI assistant files using the OpenAI client API.
    async def list_files(self):
        try:
            response = await self.client.files.list(purpose="assistants")
            return response.data
        except Exception as e:
            logger.error(f"Failed to list files: {str(e)}")
            raise
  • Registration of the 'list-files' tool in the server's list_tools() method, including its schema with no required inputs.
    types.Tool(
        name="list-files",
        description="List files available for assistants",
        inputSchema={"type": "object", "properties": {}}
    ),
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 lacks behavioral details. It doesn't disclose whether this is a read-only operation (implied by 'List' but not explicit), what the output format might be (e.g., list of file IDs or metadata), pagination behavior, or any rate limits. The description adds minimal context beyond the basic action.

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 any fluff. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place.

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 (0 parameters, no output schema, no annotations), the description is minimally adequate but lacks completeness. It doesn't explain what 'files available for assistants' means (e.g., uploaded files vs. system files), the return format, or behavioral traits like safety or performance. For a simple list tool, it meets basic needs but leaves gaps.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't mention parameters, and it adds value by specifying the scope ('available for assistants'), which isn't captured in the schema. Baseline for 0 parameters is 4, as it avoids unnecessary details.

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 available for assistants'), providing a specific purpose. However, it doesn't explicitly differentiate from sibling tools like 'upload-file' or 'delete-file' beyond the obvious list vs. create/delete distinction, which prevents a perfect score.

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 offers no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., whether files must be uploaded first), compare it to other listing tools (like 'list-assistants'), or indicate when not to use it (e.g., for filtering or detailed file retrieval).

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/snilld-ai/openai-assistant-mcp'

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