Skip to main content
Glama

get_session_history

Retrieve session progress including completed tasks, modified files, tool usage, and git commits to track development work.

Instructions

Get what has been accomplished this session - completed todos, files modified, tool calls, git commits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
working_directoryNoWorking directory for git operations. Defaults to current directory.

Implementation Reference

  • The `_get_session_history` function is the handler responsible for gathering Accomplished todos, modified files, tool calls, and recent git commits.
    async def _get_session_history(arguments: dict[str, Any]) -> dict:
        """Get what has been accomplished this session."""
        working_dir = arguments.get("working_directory") or _get_working_directory()
    
        # Get transcript info
        transcript_parser = TranscriptParser()
        session_start = transcript_parser.get_session_start_time()
    
        # Get files modified from transcript
        files_modified = transcript_parser.get_files_modified()
    
        # Get agents spawned
        agents_spawned = transcript_parser.get_agents_spawned()
    
        # Get tool calls summary
        tool_calls = transcript_parser.get_tool_calls()
        bash_commands = [
            tc["params"].get("command", "")
            for tc in tool_calls
            if tc["name"] == "Bash" and tc["params"].get("command")
        ]
    
        # Get session ID and completed todos
        session_id = None
        if transcript_parser.transcript_path:
            todo_parser = TodoParser()
            session_id = todo_parser.extract_session_id_from_transcript_path(
                transcript_parser.transcript_path
            )
    
        completed_todos = []
        if session_id:
            todo_parser = TodoParser()
            todos = todo_parser.get_todos_for_session(session_id)
            completed_todos = [t.content for t in todos.completed]
    
        # Get git commits since session start
        git = GitUtils(working_dir)
        git_commits = []
        if session_start and git.is_git_repo():
            commits = git.get_recent_commits(n=20, since=session_start)
            git_commits = [
                {"sha": c.sha[:7], "message": c.message}
                for c in commits
            ]
    
        return {
            "completed_todos": completed_todos,
            "files_modified": files_modified,
            "tool_calls": {
                "bash_commands": bash_commands[:20],  # Limit to recent
                "agents_spawned": agents_spawned,
                "files_read": sum(1 for tc in tool_calls if tc["name"] == "Read"),
                "files_written": sum(1 for tc in tool_calls if tc["name"] in ("Write", "Edit")),
            },
            "git_commits": git_commits,
        }
  • The tool `get_session_history` is defined in the `list_tools` registration function in `src/ccsession/server.py`.
        name="get_session_history",
        description="Get what has been accomplished this session - completed todos, files modified, tool calls, git commits.",
        inputSchema={
            "type": "object",
            "properties": {
                "working_directory": {
                    "type": "string",
                    "description": "Working directory for git operations. Defaults to current directory.",
                }
            },
            "required": [],
        },
    ),
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it implies a read-only operation ('get'), it doesn't specify whether this requires permissions, how data is formatted or returned, if there are rate limits, or what happens with errors. For a tool with zero annotation coverage, this is a significant gap in behavioral context.

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 with specific examples. It's front-loaded with the core function and avoids unnecessary words, making it easy for an agent 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?

Given the tool's moderate complexity (retrieving session history) and the absence of annotations and output schema, the description is minimally adequate. It covers what data is retrieved but lacks details on return format, error handling, or behavioral traits. With no output schema, the agent must infer return values from the description alone, which is incomplete.

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?

The schema description coverage is 100%, so the input schema already documents the single parameter 'working_directory' with its type and default. The description adds no additional parameter information beyond what the schema provides, such as examples or edge cases. Baseline 3 is appropriate when the schema handles parameter documentation adequately.

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 tool's purpose: to retrieve session history including completed todos, files modified, tool calls, and git commits. It specifies the verb 'get' and the resource 'session history' with concrete examples of what's included. However, it doesn't explicitly differentiate from sibling tools like 'get_session_state' or 'check_context_budget', which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when this tool is appropriate, when not to use it, or how it differs from sibling tools such as 'get_session_state' or 'should_reset_context'. This leaves the agent without contextual usage information.

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/TimEvans/ccsession'

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