Skip to main content
Glama
snilld-ai
by snilld-ai

list-files

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

Instructions

List files available for assistants

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'list-files' tool in the list_tools handler, including its input schema (empty object) and description.
    types.Tool( name="list-files", description="List files available for assistants", inputSchema={"type": "object", "properties": {}} ),
  • MCP tool handler for 'list-files': calls LLMConnector.list_files(), formats the list of files into a string, and returns as TextContent.
    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}")]
  • Core implementation of file listing in LLMConnector: asynchronously lists OpenAI files with purpose='assistants' using the OpenAI client.
    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

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