Skip to main content
Glama

context_delete

Remove specific context entries by ID to manage stored session data and maintain organized workspace resources.

Instructions

Delete a specific context by ID

Input Schema

NameRequiredDescriptionDefault
context_idYesContext ID to delete

Input Schema (JSON Schema)

{ "properties": { "context_id": { "description": "Context ID to delete", "type": "string" } }, "required": [ "context_id" ], "type": "object" }

Implementation Reference

  • Handler in call_tool method that executes the context_delete tool by extracting context_id and calling storage.delete_context, returning success or not found message.
    if name == "context_delete": context_id = arguments["context_id"] deleted = self.storage.delete_context(context_id) if deleted: return [TextContent(type="text", text=f"āœ“ Context {context_id} deleted")] return [TextContent(type="text", text=f"Context {context_id} not found")]
  • Tool schema definition including input schema for context_delete in list_tools method.
    Tool( name="context_delete", description="Delete a specific context by ID", inputSchema={ "type": "object", "properties": { "context_id": {"type": "string", "description": "Context ID to delete"}, }, "required": ["context_id"], }, ),
  • Core helper method in ContextStorage that performs the actual database deletion of the context by ID.
    def delete_context(self, context_id: str) -> bool: """Delete a context by ID. Returns True if deleted, False if not found.""" with closing(sqlite3.connect(self.db_path)) as conn: cursor = conn.execute("DELETE FROM contexts WHERE id = ?", (context_id,)) conn.commit() return cursor.rowcount > 0

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/taylorleese/mcp-toolz'

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