Skip to main content
Glama
taylorleese

mcp-toolz

context_list

Retrieve recent Claude Code contexts to review conversations, code snippets, suggestions, or errors across sessions.

Instructions

List recent Claude Code contexts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results
typeNoFilter by type (conversation, code, suggestion, error)

Implementation Reference

  • The handler logic for the 'context_list' tool within the call_tool method. It retrieves recent contexts using storage.list_contexts with optional limit and type filter, formats them, and returns as TextContent.
    if name == "context_list":
        limit = arguments.get("limit", 20)
        type_filter = arguments.get("type")
        contexts = self.storage.list_contexts(type_filter=type_filter, limit=limit)
        result = self._format_contexts_response(contexts)
        return [TextContent(type="text", text=result)]
  • Input schema definition for the 'context_list' tool, including properties for limit and type filter.
    Tool(
        name="context_list",
        description="List recent Claude Code contexts",
        inputSchema={
            "type": "object",
            "properties": {
                "limit": {
                    "type": "integer",
                    "description": "Maximum number of results",
                    "default": 20,
                },
                "type": {
                    "type": "string",
                    "description": "Filter by type (conversation, code, suggestion, error)",
                    "enum": ["conversation", "code", "suggestion", "error"],
                },
            },
        },
    ),
  • The list_tools method registers the 'context_list' tool by including it in the returned list of Tool objects, which is hooked to the MCP server.
    async def list_tools(self) -> list[Tool]:
        """List available tools."""
        return [
            # Context tools
            Tool(
                name="context_search",
                description="Search Claude Code contexts by query string or tags",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "query": {"type": "string", "description": "Search query"},
                        "tags": {
                            "type": "array",
                            "items": {"type": "string"},
                            "description": "Filter by tags",
                        },
                        "type": {
                            "type": "string",
                            "description": "Filter by type (conversation, code, suggestion, error)",
                            "enum": ["conversation", "code", "suggestion", "error"],
                        },
                        "limit": {
                            "type": "integer",
                            "description": "Maximum number of results",
                            "default": 10,
                        },
                    },
                },
            ),
            Tool(
                name="context_get",
                description="Get full details of a specific context by ID",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "context_id": {"type": "string", "description": "Context ID"},
                    },
                    "required": ["context_id"],
                },
            ),
            Tool(
                name="context_list",
                description="List recent Claude Code contexts",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "limit": {
                            "type": "integer",
                            "description": "Maximum number of results",
                            "default": 20,
                        },
                        "type": {
                            "type": "string",
                            "description": "Filter by type (conversation, code, suggestion, error)",
                            "enum": ["conversation", "code", "suggestion", "error"],
                        },
                    },
                },
            ),
            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"],
                },
            ),
            Tool(
                name="context_save",
                description="Save a new context entry for the current project",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string",
                            "description": "Context type",
                            "enum": ["conversation", "code", "suggestion", "error"],
                        },
                        "title": {"type": "string", "description": "Context title"},
                        "content": {"type": "string", "description": "Context content"},
                        "tags": {
                            "type": "array",
                            "items": {"type": "string"},
                            "description": "Tags for categorization",
                        },
                        "session_context_id": {
                            "type": "string",
                            "description": "Link to existing context ID",
                        },
                    },
                    "required": ["type", "title", "content"],
                },
            ),
            # Todo tools
            Tool(
                name="todo_search",
                description="Search todo snapshots by content or context description",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "query": {"type": "string", "description": "Search query"},
                        "project_path": {
                            "type": "string",
                            "description": "Filter by project path",
                        },
                        "limit": {
                            "type": "integer",
                            "description": "Maximum number of results",
                            "default": 10,
                        },
                    },
                    "required": ["query"],
                },
            ),
            Tool(
                name="todo_get",
                description="Get full details of a specific todo snapshot by ID",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "snapshot_id": {"type": "string", "description": "Todo snapshot ID"},
                    },
                    "required": ["snapshot_id"],
                },
            ),
            Tool(
                name="todo_list",
                description="List recent todo snapshots",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "limit": {
                            "type": "integer",
                            "description": "Maximum number of results",
                            "default": 20,
                        },
                        "project_path": {
                            "type": "string",
                            "description": "Filter by project path",
                        },
                    },
                },
            ),
            Tool(
                name="todo_save",
                description="Save a new todo snapshot",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "todos": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "content": {"type": "string"},
                                    "status": {"type": "string", "enum": ["pending", "in_progress", "completed"]},
                                    "activeForm": {"type": "string"},
                                },
                                "required": ["content", "status", "activeForm"],
                            },
                            "description": "List of todo items",
                        },
                        "project_path": {
                            "type": "string",
                            "description": "Project path (defaults to current directory)",
                        },
                        "context": {
                            "type": "string",
                            "description": "Description of what you're working on",
                        },
                        "session_context_id": {
                            "type": "string",
                            "description": "Link to existing context ID",
                        },
                    },
                    "required": ["todos"],
                },
            ),
            Tool(
                name="todo_restore",
                description="Get todo snapshot for restoring (active snapshot or specific ID)",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "snapshot_id": {
                            "type": "string",
                            "description": "Specific snapshot ID (optional, defaults to active snapshot)",
                        },
                        "project_path": {
                            "type": "string",
                            "description": "Project path (used if snapshot_id not provided)",
                        },
                    },
                },
            ),
            Tool(
                name="todo_delete",
                description="Delete a specific todo snapshot by ID",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "snapshot_id": {"type": "string", "description": "Todo snapshot ID to delete"},
                    },
                    "required": ["snapshot_id"],
                },
            ),
            # AI opinion tools
            Tool(
                name="ask_chatgpt",
                description="Ask ChatGPT a question about a context entry, or get a general second opinion",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "context_id": {"type": "string", "description": "Context ID to ask about"},
                        "question": {
                            "type": "string",
                            "description": (
                                "Optional specific question to ask about the context. If not provided, gets a general second opinion."
                            ),
                        },
                    },
                    "required": ["context_id"],
                },
            ),
            Tool(
                name="ask_claude",
                description="Ask Claude a question about a context entry, or get a general second opinion",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "context_id": {"type": "string", "description": "Context ID to ask about"},
                        "question": {
                            "type": "string",
                            "description": (
                                "Optional specific question to ask about the context. If not provided, gets a general second opinion."
                            ),
                        },
                    },
                    "required": ["context_id"],
                },
            ),
            Tool(
                name="ask_gemini",
                description="Ask Google Gemini a question about a context entry, or get a general second opinion",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "context_id": {"type": "string", "description": "Context ID to ask about"},
                        "question": {
                            "type": "string",
                            "description": (
                                "Optional specific question to ask about the context. If not provided, gets a general second opinion."
                            ),
                        },
                    },
                    "required": ["context_id"],
                },
            ),
            Tool(
                name="ask_deepseek",
                description="Ask DeepSeek a question about a context entry, or get a general second opinion",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "context_id": {"type": "string", "description": "Context ID to ask about"},
                        "question": {
                            "type": "string",
                            "description": (
                                "Optional specific question to ask about the context. If not provided, gets a general second opinion."
                            ),
                        },
                    },
                    "required": ["context_id"],
                },
            ),
        ]
  • Helper method used by the context_list handler to format the list of contexts into a readable string response.
    def _format_contexts_response(self, contexts: list[ContextEntry]) -> str:
        """Format a list of contexts for response."""
        if not contexts:
            return "No contexts found."
    
        lines = [f"Found {len(contexts)} contexts:\n"]
        for ctx in contexts:
            chatgpt_icon = "✓" if ctx.chatgpt_response else "○"
            claude_icon = "✓" if ctx.claude_response else "○"
            gemini_icon = "✓" if ctx.gemini_response else "○"
            deepseek_icon = "✓" if ctx.deepseek_response else "○"
            tags_str = f" [{', '.join(ctx.tags)}]" if ctx.tags else ""
            ai_icons = f"GPT:{chatgpt_icon} Claude:{claude_icon} Gemini:{gemini_icon} DeepSeek:{deepseek_icon}"
            lines.append(f"{ai_icons} [{ctx.type}] {ctx.title}{tags_str}\n   ID: {ctx.id}\n   Timestamp: {ctx.timestamp.isoformat()}\n")
        return "\n".join(lines)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'recent' contexts but doesn't define what 'recent' means, doesn't explain ordering, pagination, or what data is returned. For a list tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 with zero wasted words. It's appropriately sized and front-loaded with the core functionality, making it easy to parse quickly.

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?

For a simple list tool with 2 well-documented parameters and no output schema, the description is minimally adequate. However, it lacks important context about what 'recent' means, ordering, and return format, which would be helpful given the absence of annotations and output schema.

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 fully documents both parameters. The description doesn't add any parameter-specific information beyond what's already in the schema, so the baseline score of 3 is appropriate when the schema does the heavy lifting.

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 ('recent Claude Code contexts'), making the purpose immediately understandable. It doesn't explicitly distinguish from sibling tools like context_search or context_get, but the core functionality is well-defined.

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 guidance is provided on when to use this tool versus alternatives like context_search or context_get. The description simply states what it does without indicating appropriate use cases, prerequisites, or exclusions.

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

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