Skip to main content
Glama
snilld-ai

OpenAI Assistant MCP Server

by snilld-ai

upload-file

Upload files to OpenAI Assistants for processing and analysis, enabling document-based interactions through the MCP server.

Instructions

Upload a file for use by assistants

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesThe local path to the file to upload

Implementation Reference

  • Core handler implementation: uploads the file to OpenAI assistants using the OpenAI client.files.create API.
    async def upload_file(self, file_path: str):
        try:
            with open(file_path, "rb") as file:
                response = await self.client.files.create(file=file, purpose="assistants")
            return response
        except Exception as e:
            logger.error(f"Failed to upload file {file_path}: {str(e)}")
            raise
  • Tool registration in list_tools(), including name, description, and input schema.
    types.Tool(
        name="upload-file",
        description="Upload a file for use by assistants",
        inputSchema={
            "type": "object",
            "properties": {
                "file_path": {"type": "string", "description": "The local path to the file to upload"}
            },
            "required": ["file_path"]
        }
    ),
  • Dispatch handler in call_tool() that invokes the LLMConnector.upload_file method and formats the response.
    elif name == "upload-file":
        response = await connector.upload_file(arguments["file_path"])
        return [types.TextContent(type="text", text=f"File uploaded: {response.filename}, ID: {response.id}")]
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 the tool uploads files but doesn't mention permissions required, file size limits, supported formats, whether uploads are permanent, or what happens after upload. This is inadequate for a mutation tool with zero annotation coverage.

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's appropriately sized for a simple tool with one parameter.

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?

For a file upload tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after upload, whether files are stored persistently, what authentication is needed, or any error conditions. The context signals indicate this is a mutation tool (upload implies write), yet behavioral details are missing.

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 the single parameter 'file_path'. The description doesn't add any parameter-specific information beyond what's in the schema, maintaining the baseline score.

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 ('upload') and resource ('a file'), specifying it's 'for use by assistants'. However, it doesn't distinguish this from sibling tools like 'delete-file' or 'list-files' beyond the obvious verb difference.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description mentions 'for use by assistants' but doesn't specify prerequisites, constraints, or when other file-related tools might be more appropriate.

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