Skip to main content
Glama

Get block schema

get_block_schema

Retrieve the full block schema for any Scratch opcode, including inputs, fields, dropdown options, shadow encoding, and a ready-to-adapt example, enabling correct block creation with patch_target.

Instructions

The full schema for one block opcode: its shape, every input (with the sb3 shadow encoding to use, e.g. a text input is [1, [10, "hi"]]), every field (with enumerated dropdown options where applicable), and a ready-to-adapt example block JSON. Read this before writing a block with patch_target. In the example, <…> placeholders (block ids, variable ids) must be replaced with real ones; menu inputs also need a matching shadow block (opcode menuOpcode, a field named menuField, shadow: true). Dynamic menu options (sprites, sounds, costumes, …) are filled from the open project; pass target to enumerate that sprite's own costumes and sounds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opcodeYesA block opcode, e.g. "looks_say" or "control_if".
targetNoSprite name (or "Stage") whose costumes/sounds should populate dynamic menus.
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the output format in detail: shape, inputs with sb3 shadow encoding, fields with dropdown options, and an example block JSON. It also discloses that placeholders like `<…>` must be replaced, menu inputs need a matching shadow block, and dynamic menu options are populated from the open project. This goes well beyond a simple 'get schema' statement, though it does not cover error handling or rate limits.

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?

The description is somewhat long but densely packed with necessary details. It front-loads the main purpose and then provides crucial usage specifics (shadow encoding, placeholders, dynamic menus). While it could be trimmed slightly, every sentence carries operational meaning and earns its place, making it efficient for a complex tool.

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?

Given there is no output schema, the description must convey what the tool returns, which it does thoroughly: schema structure, inputs, fields, example JSON, and interpretation notes. It also explains the context of use relative to patch_target and the role of the target parameter. It lacks explicit error behavior for unknown opcodes, but for an agent needing to fetch and use a block schema, the description is largely complete.

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?

The input schema already has 100% coverage with descriptions for both parameters. The tool description adds further semantic depth: it clarifies that 'opcode' is a block opcode with examples, and explains that 'target' is used specifically to populate dynamic menus with that sprite's costumes and sounds. This enriches the schema's bare definitions, so the description adds genuine value beyond the structured fields.

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 clearly states what the tool does: returns the full schema for one block opcode, including shape, inputs with shadow encoding, fields with options, and example JSON. It distinguishes itself from siblings like patch_target (writing blocks) and list_blocks by focusing on schema retrieval. The verb 'get' plus specific resource 'block schema' makes 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 Guidelines4/5

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

The description explicitly says 'Read this before writing a block with patch_target', which is clear when-to-use guidance. It also explains when to pass the 'target' parameter (to populate dynamic menus) and mentions the need for shadow blocks for menu inputs. It does not, however, explicitly state when not to use this tool or name alternatives, but the context is sufficient for an agent to decide.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AstroBlocksMod/ScratchMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server