Skip to main content
Glama

drain_replica

Destructive

Attempts to drain one Ray Serve replica, but returns a teaching error because per-replica draining is unavailable over REST; scale the deployment down to retire surplus replicas.

Instructions

[WRITE][risk=high] Drain one replica — NOT available over Ray's REST API.

Ray Serve exposes no per-replica drain endpoint (only the whole-cluster declarative config); individual-replica draining is a Python-API capability only. This tool refuses with a teaching error. To retire surplus replicas, scale the deployment down — the controller drains them gracefully. The dry_run preview reports the same unavailability rather than a false green.

Args: application: Serve application name. deployment: Deployment name. replica_id: Replica id (from replica_list). dry_run: If True, report availability without attempting a drain. target: Inference target name from config; omit for the default.

Input Schema

NameRequiredDescriptionDefault
targetNo
dry_runNo
deploymentYes
replica_idYes
applicationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.2/5.0
Behavior4/5

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

With annotations present the bar is lower, yet the description adds substantial context beyond them: it discloses that the tool performs no drain and returns a teaching error, that the limitation is REST-vs-Python-API, and that dry_run previews the same unavailability 'rather than a false green.' It does not describe the error/return shape, but the key behavioral traits are well covered.

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?

Front-loaded with the [WRITE][risk=high] marker and the crucial unavailability fact, then structured with an Args block. The middle sentences restate the unavailability theme a few times ('no per-replica drain endpoint' / 'Python-API capability only' / 'refuses'), a touch of redundancy, but nothing is wasted overall.

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?

No output schema exists, and the description nonetheless explains that the tool refuses and what the dry_run preview does. For a refusal/teaching stub with a 5-param signature, the essential facts (unavailable, why, correct alternative) are all present; only the concrete error-response format is left implicit.

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 description coverage is 0%, so the description must carry the load — and its Args section documents all five parameters: application, deployment, replica_id (with source hint 'from replica_list'), dry_run (behavior when true), and target (default behavior when omitted). This compensates well for the empty schema, though the per-parameter detail is brief.

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?

States a specific verb+resource (drain one replica) and immediately clarifies the actual behavior — the tool refuses with a teaching error because per-replica drain is not exposed over Ray's REST API. It distinguishes itself from siblings by routing surplus-replica retirement to a scale-down instead. Slight naming oddity: the title implies a working drain while the body says it is a stub, but the description resolves this clearly.

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

Usage Guidelines5/5

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

Explicitly states the when-not (no per-replica drain endpoint; Python-API only) and the alternative ('To retire surplus replicas, scale the deployment down — the controller drains them gracefully'). An agent knows not to rely on this tool and exactly what to do instead, with no inference required.

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