cleanup_expired_sessions

Remove expired sessions and their associated data from the database.

Server Codeviewer master0ffate/codeviewer-mcp
Category Destructive
Risk class Critical
Parameters 00 required

What cleanup_expired_sessions does on Codeviewer

AI agents call cleanup_expired_sessions to permanently remove resources in Codeviewer — typically in cleanup and lifecycle workflows. It does its job in a single call, and there is no undo.

Why cleanup_expired_sessions needs a policy

This tool deletes data from persistent storage without a recovery mechanism. Although the sessions are described as 'expired' (suggesting automation eligibility), an AI agent could be manipulated to call this tool prematurely, corrupt session state, or clear audit trails. The irreversible nature and data loss potential make this Destructive rather than Write.

From the tool's definition The tool performs 'Remove expired sessions and their associated data from the database' — a permanent deletion operation that cannot be undone. The use of 'Remove' combined with 'associated data' and 'database' indicates irreversible data destruction.

Questions about cleanup_expired_sessions

What does the cleanup_expired_sessions tool do? +

Remove expired sessions and their associated data from the database. It is categorised as a Destructive tool in the Codeviewer MCP Server, which means it can permanently delete or destroy data. Block by default and require explicit approval.

How do I enforce a policy on cleanup_expired_sessions? +

Register the Codeviewer MCP server in PolicyLayer and add a rule for cleanup_expired_sessions: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Codeviewer. Nothing to install.

What risk level is cleanup_expired_sessions? +

cleanup_expired_sessions is a Destructive tool with critical risk. Critical-risk tools should be blocked by default and only enabled with explicit human approval.

Can I rate-limit cleanup_expired_sessions? +

Yes. Add a rate_limit block to the cleanup_expired_sessions rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block cleanup_expired_sessions completely? +

Set action: deny in the PolicyLayer policy for cleanup_expired_sessions. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides cleanup_expired_sessions? +

cleanup_expired_sessions is provided by the Codeviewer MCP server (master0ffate/codeviewer-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

// THE FULL RECORD

cleanup_expired_sessions is one line of Codeviewer's registry record.

The record carries the whole server: verified identity, auth posture, risk grade, every tool classified, recommended policy — re-checked continuously.

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.