Skip to main content
Glama

stop_session

Ends an active behavioral tracking session in the jikan MCP server. The tool automatically calculates session duration using stored timestamps, eliminating manual time tracking for activities like meditation, focus, or exercise.

Instructions

Stop an active session. Free (0 credits).

The server computes actual_sec automatically using the stored start time.
The agent does not need to track elapsed time.

Args:
    ak_id: The session ID returned by start_session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ak_idYes

Implementation Reference

  • server.py:55-67 (handler)
    The stop_session tool handler - decorated with @mcp.tool() for registration. Takes an ak_id parameter and makes a PATCH request to /sessions/{ak_id}/stop to stop an active session. Returns the server response as a dict.
    @mcp.tool()
    def stop_session(ak_id: int) -> dict:
        """Stop an active session. Free (0 credits).
    
        The server computes actual_sec automatically using the stored start time.
        The agent does not need to track elapsed time.
    
        Args:
            ak_id: The session ID returned by start_session.
        """
        with _client() as client:
            response = client.patch(f"/sessions/{ak_id}/stop")
        return response.json()
  • The _client() helper function that creates and returns an httpx.Client instance configured with the base URL, API key headers, and 30-second timeout. Used by stop_session to make HTTP requests.
    def _client() -> httpx.Client:
        return httpx.Client(base_url=MG_BASE_URL, headers=HEADERS, timeout=30)
Behavior4/5

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

With no annotations provided, the description carries the full burden and adds valuable behavioral context: it discloses that the operation is 'Free (0 credits)', explains server-side computation of 'actual_sec' automatically, and clarifies that the agent doesn't need to track elapsed time. This goes beyond the basic 'stop' action to include cost and automation details, though it lacks information on permissions or error handling.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by key behavioral details (cost, automation), and ends with parameter explanation. Every sentence earns its place with no redundant or vague language, making it highly efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/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 (a mutation operation with no annotations or output schema), the description is mostly complete: it covers purpose, usage context, behavioral traits, and parameter semantics. However, it lacks details on potential side effects (e.g., what happens to session data after stopping) or error cases, leaving minor gaps for a mutation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate fully. It explicitly defines the single parameter 'ak_id' as 'The session ID returned by start_session', adding crucial meaning not present in the schema (which only lists it as 'Ak Id' with type integer). This provides clear semantics and usage guidance for the parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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 with a specific verb ('Stop') and resource ('an active session'), distinguishing it from siblings like 'start_session' (which initiates) and 'check_session' (which queries). It goes beyond tautology by specifying the action on a particular resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for usage by mentioning it stops 'an active session' and references 'start_session' as the source for the required session ID. However, it does not explicitly state when NOT to use this tool (e.g., for inactive sessions) or name alternatives like 'check_session' for verification, which prevents a perfect score.

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/thunderrabbit/jikan'

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