Skip to main content
Glama

Stop Labor Session

stop_labor_session
Idempotent

Stop a running work session and record its time, from its start to now, against the run. In the app, with nothing named, stops the signed-in worker's own session (User role), as their my-work page does. Naming sessionId, or a worker (id or full name) whose running session to stop, stops someone else's session as the labor planner screen does and needs Admin; connectors must name one. A session already stopped is refused. Preview first; the in-app assistant gets a confirm card.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "stop_labor_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
workerNoA worker id (GUID) or full name whose running session to stop.
previewNoStep 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing changes until the commit call.
sessionIdNoThe work session id (GUID), from get_labor_work_day or get_labor_operation.
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 2 of the required two-step write: the receipt returned by the preview call. Supply together with a fresh idempotencyKey to commit; calls without it are refused.

Output Schema

NameRequiredDescriptionDefault
okNo
previewNo
requestNo
recordedNo
committedNo
expiresAtNo
actionItemIdNo
confirmationNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
idempotentReplayNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare the write profile (readOnlyHint=false, idempotentHint=true, destructiveHint=false); the description adds real context beyond them, namely the Admin authorization requirement for stopping another worker's session, the precondition that a stopped session is refused, the required two-step preview/commit flow, and the confirm card presented to the in-app assistant. The description's 'stop and record time' framing is consistent with destructiveHint=false, since the session record persists and only its end time is set.

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?

Five sentences, all substantive, with the action front-loaded and the role/precondition caveats following. The middle sentence ('Naming sessionId, or a worker ... as the labor planner screen does and needs Admin') is tangled enough to require a second read, costing a little clarity.

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

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a write tool with five optional parameters and a two-step preview/commit contract, the description covers authorization, preconditions, the preview requirement, and the target-selection semantics. Return-value detail is unnecessary because an output schema exists and all parameters are documented in the schema.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds meaning the schema does not: it explains that supplying nothing is a valid, meaningful default that targets the signed-in worker, and that the worker parameter accepts an id or a full name. That materially clarifies the null defaults on sessionId and worker.

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 opens with a concrete verb and resource ('Stop a running work session and record its time, from its start to now, against the run'), which cleanly separates it from the sibling start_labor_session and from time-recording tools. It also names the two target modes (own session vs. someone else's by sessionId/worker), so an agent knows exactly what scope of action the tool performs.

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?

Usage context is unusually explicit: with nothing named it stops the signed-in worker's own session, while naming sessionId or a worker targets someone else's and requires Admin, and connectors must name one. It also states that an already-stopped session is refused and that preview comes first, which tells the agent when the call will fail. It stops short of naming an alternative tool for cases where the caller should not stop a session at all.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources