delete-assistant
Remove an OpenAI assistant by providing its ID to manage your assistant inventory and maintain organization.
Instructions
Delete an OpenAI assistant
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assistant_id | Yes | The ID of the assistant to delete |
Implementation Reference
- src/mcp_server_openai/llm.py:79-85 (handler)The core handler function in LLMConnector that deletes the OpenAI assistant using the AsyncOpenAI client.async def delete_assistant(self, assistant_id: str): try: response = await self.client.beta.assistants.delete(assistant_id) return response except Exception as e: logger.error(f"Failed to delete assistant {assistant_id}: {str(e)}") raise
- src/mcp_server_openai/server.py:90-100 (registration)Registers the 'delete-assistant' tool in the list_tools handler, including its description and input schema.types.Tool( name="delete-assistant", description="Delete an OpenAI assistant", inputSchema={ "type": "object", "properties": { "assistant_id": {"type": "string", "description": "The ID of the assistant to delete"} }, "required": ["assistant_id"] } ),
- src/mcp_server_openai/server.py:188-191 (handler)Dispatches the tool call to the LLMConnector's delete_assistant method and formats the response.elif name == "delete-assistant": assistant_id = arguments["assistant_id"] response = await connector.delete_assistant(assistant_id) return [types.TextContent(type="text", text=f"Assistant deleted: {response.id}, status: {'deleted' if response.deleted else 'not deleted'}")]