Skip to main content
Glama
Canada's Food Guide MCP Server

Canada's Food Guide MCP Server

Cleanup Temp Sessions

cleanup_temp_sessions

Clean up temporary session data by targeting one session, all sessions, or sessions older than a set age; removes temp SQLite tables and session records while preserving favorites and persistent data.

Instructions

Clean up temporary session data - can target specific session or clean all sessions.

๐Ÿงน UNIFIED CLEANUP TOOL - Handles both specific session cleanup and complete cleanup

Usage Modes:

  1. Specific Session: cleanup_temp_sessions(session_id="my_session") โ†’ Clean specific session only

  2. All Sessions: cleanup_temp_sessions() โ†’ Clean ALL existing sessions (default behavior)

  3. Age-based: cleanup_temp_sessions(hours_old=48) โ†’ Clean sessions older than 48 hours

  4. Combined: cleanup_temp_sessions(session_id="current", auto_cleanup_old=True) โ†’ Clean current + all others

What Gets Cleaned:

  • All temporary SQLite tables: temp_recipes, temp_recipe_ingredients, temp_cnf_foods, temp_cnf_nutrients, temp_recipe_macros

  • Virtual session data from memory

  • Session tracking records

Safety Features:

  • Only cleans session-scoped data

  • Preserves user favorites and persistent data

  • Reports exactly what was cleaned

Input Schema

NameRequiredDescriptionDefault
hours_oldNoOptional hours of inactivity before auto-cleanup (None = clean all)
session_idNoOptional specific session to clean up
auto_cleanup_oldNoWhether to also clean old sessions (default True)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description does substantial work: it discloses that a no-argument call cleans all existing sessions, lists the SQLite tables and other records affected, and states that favorites and persistent data are preserved. It does not explicitly address irreversibility or any confirmation precondition for this destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Headings, numbered examples, and cleanup and safety bullets make the detailed description easy to scan, with the core purpose front-loaded. The opening sentence and unified-cleanup banner are redundant, and the emoji and emphasis add little operational value.

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?

For three optional parameters and an existing output schema, the description covers usage modes, affected state, preserved data, and cleanup reporting without needing to explain return values. Its remaining gaps are sibling routing, precise parameter interactions, and the irreversibility of a broadly destructive default operation.

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 coverage is 100%, and the examples add practical invocation values and clarify that hours_old=48 selects sessions older than 48 hours. However, the session_id-only example claims to clean only that session despite auto_cleanup_old defaulting to true, while the combined example uses that same default to clean additional sessions, leaving the parameter interaction ambiguous.

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?

Clearly states that the tool cleans temporary session data and identifies specific-session, all-session, and age-based scopes. It also enumerates the affected temporary tables and in-memory state, but does not distinguish this unified operation from the sibling cleanup_virtual_session tool.

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?

Four numbered modes with concrete calls explain targeted cleanup, default all-session cleanup, age-based cleanup, and combined use. There is no explicit when-not guidance or sibling alternative, and the 'specific session only' example is difficult to reconcile with auto_cleanup_old defaulting to true.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.