Skip to main content
Glama
microbit-makecode-mcp

microbit-makecode-mcp

set_code

Replaces the open MakeCode project's entire program with TypeScript, shows it as blocks, and compiles it, returning errors and whether block conversion succeeded.

Instructions

Replace the open project's whole program with MakeCode TypeScript, show it as blocks, and compile it. Returns compile errors (fix and call again until errors is empty) and whether it converted to blocks. Overwrites the program: call get_code first if it may hold the user's work, or use new_project.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "set_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesComplete MakeCode TypeScript program (replaces main.ts)
viewNoEditor view to show afterwards. Default blocks (falls back to javascript if the code has no block form)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it discloses the destructive overwrite, the editor side effect (view switches to blocks), the return payload (compile errors plus a blocks-conversion flag), and the fallback to javascript when no block form exists. This is exactly the context an agent needs before an irreversible write.

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, front-loaded with the action, then the returns, then the safety warning — no filler. Slightly dense with parenthetical asides, but every clause carries operational meaning.

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 two-parameter mutation with no output schema and no annotations, the description covers action, side effects, return values, failure handling, and recovery path. An agent could call this correctly and handle the result without further information.

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 coverage is 100% and both parameters are fully documented there, including the view enum and its default/fallback. The description adds no parameter-level semantics beyond what the schema already states, so the 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 concrete verb and resource ('Replace the open project's whole program with MakeCode TypeScript') plus the follow-on actions (show as blocks, compile). It clearly separates itself from get_code and new_project, which are named explicitly.

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?

Gives an explicit precondition ('call get_code first if it may hold the user's work'), names the alternative for the greenfield case ('or use new_project'), and even prescribes the retry loop ('fix and call again until errors is empty'). Nothing about when to choose this tool is left to inference.

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