Skip to main content
Glama

set_state_schema

Define a new state schema for your LangGraph graph by specifying fields with types, reducers, and defaults. Replaces the existing schema entirely to adapt graph behavior.

Instructions

Replace the graph's state schema wholesale.

Each field: {name, type, reducer?, default?}. type is a raw Python type expression (e.g. "str", "list[str]"); reducer names a reducer function (e.g. "add_messages", or a custom name defined in reducers.py).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsYes
project_dirYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full disclosure burden. It does convey the destructive nature ('replace wholesale') and documents the field contract ({name, type, reducer?, default?}) plus the type/reducer syntax. However, it omits error behavior (e.g., invalid Python type expressions), validation of the schema, and side effects on nodes referencing old fields. The documented field structure adds genuine value, but coverage is incomplete.

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?

Three sentences with the core purpose front-loaded in the first sentence and supporting field details in the following two. No filler or redundant phrasing; each sentence earns its place.

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

Completeness3/5

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

An output schema exists, so return-value documentation is not required. The description covers the input contract for 'fields' but lacks error-condition disclosure and side-effect context (what happens to existing nodes or references after a wholesale schema swap). For a schema-replacement mutation, this is a meaningful gap, though the tool has only two parameters and moderate complexity.

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 compensate, and it does substantially for 'fields' by defining each sub-field's shape and the exact syntax of 'type' and 'reducer' with examples. However, 'project_dir' receives zero explanation—no hint that it is the project path or how it is used. The main parameter is richly documented, but one of the two required parameters is ignored.

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 specific verb+resource+scope: 'Replace the graph's state schema wholesale.' This clearly distinguishes it from sibling tools like add_node/add_edge (which mutate graph structure) and init_project (project setup). The 'wholesale' qualifier precisely conveys full replacement, making the purpose unambiguous.

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

Usage Guidelines2/5

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

The description states what the tool does but gives no guidance on when to choose it over alternatives, and never names a sibling or an exclusion condition. There is no mention of when incremental updates would be preferable or when this wholesale replacement is appropriate. Usage context is entirely implied by the purpose.

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