Skip to main content
Glama

给会话换模型

piweb_set_model
Idempotent

Switch the model a session uses next, starting the session if needed. Use piweb_list_models to find valid provider and model IDs.

Instructions

切换某个会话接下来使用的模型(等价于界面上的模型选择)。会话没在运行时会被拉起来。取值先用 piweb_list_models 查。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionYes会话 id / 名称
model_idYes模型 id,如 deepseek-flash
providerYes模型 provider,如 new-api-half / opencode / deepseek

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, openWorldHint=true and idempotentHint=true, so mutation and idempotency are already covered structurally. The description adds a genuinely useful side-effect disclosure: a non-running session will be started as a result of the call, which the annotations do not convey. It omits any note on permissions or behavior on an invalid model id.

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?

Three short sentences, no filler, with the core effect stated first, the side effect second and the prerequisite lookup last. Every sentence carries distinct information.

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 a three-required-parameter mutation with no output schema, the description covers effect, side effect and prerequisite adequately. It leaves open whether the change applies to an in-flight turn and what an invalid provider/model_id yields, minor gaps for this tool's complexity.

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 description coverage is 100%, with each of session, model_id and provider documented inline including examples, so the schema does the heavy lifting. The description adds only the provenance hint (values come from piweb_list_models), which is a mild but real addition beyond the schema. Baseline 3 applies.

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?

States a specific verb and resource (switch the model a session will use next) and anchors it to a familiar UI equivalent, so the agent immediately knows the effect. It also names the sibling piweb_list_models as the value source, distinguishing it from read-only siblings like piweb_list_models or piweb_get_session.

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?

Explicitly directs the agent to call piweb_list_models first to obtain valid provider/model_id values, which is actionable usage guidance. It does not state when not to use it (e.g. mid-turn, or sessions where the model is locked), so it stops short of full when/when-not coverage.

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