Skip to main content
Glama

clock_set

Program an STM32 clock tree using RCC or friendly parameters, re-solve it via CubeMX, then save and return derived frequencies.

Instructions

Program the clock tree. Accepts explicit RCC parameters or the friendly keys: sysclk_hz, pll_mul, pll_source, sysclk_source, ahb_div, apb1_div, apb2_div, hse_mhz, hsi_mhz, lse_khz, lsi_khz. Runs clock resolution so CubeMX re-solves the tree, then saves and returns the derived frequencies.

Input Schema

NameRequiredDescriptionDefault
saveNoPersist to the .ioc
paramsNoRaw RCC parameter map, e.g. {PLLMUL: RCC_PLL_MUL9}
ahb_divNoAHB prescaler (RCC_SYSCLK_DIV1)
hse_mhzNoHSE crystal value in MHz
hsi_mhzNoHSI value in MHz
lse_khzNoLSE value in kHz
lsi_khzNoLSI value in kHz
pll_mulNoPLL multiplier token (RCC_PLL_MUL9 / PLLMUL9)
apb1_divNoAPB1 prescaler (RCC_HCLK_DIV2)
apb2_divNoAPB2 prescaler (RCC_HCLK_DIV1)
hse_pinsNoPin hints for the crystal (F1: PD0/PD1, F4/H7: PH0/PH1)
route_hseNoMux OSC_IN/OSC_OUT to HSE when PLL sources from HSE
sysclk_hzNoTarget HCLK in Hz (writes AHBFreq_Value)
pll_sourceNoPLL source (RCC_PLLSOURCE_HSE / HSI_DIV2)
project_idYesProject id
sysclk_sourceNoRCC_SYSCLKSOURCE_PLLCLK / HSI / HSE

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral burden. It usefully discloses that the tool runs clock resolution, saves, and returns derived frequencies. However, it does not mention error handling, whether invalid configurations are rejected safely, or what happens when save=false.

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 front-loaded and concise, with three sentences that each contribute useful information. The long friendly-key list is relevant, though it repeats schema content somewhat.

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?

For a 16-parameter mutation tool with no annotations and no output schema, the description covers the main flow and return values. It still leaves gaps around save behavior, error cases, and side effects on the project.

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%, so the schema already documents all 16 parameters. The description adds a helpful grouping by listing the friendly keys, but does not add syntax or semantics beyond what the schema provides.

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?

The description opens with a specific verb and resource: 'Program the clock tree.' It clearly sets this apart from read-only clock tools like clock_get and clock_resolve, though it does not explicitly name those siblings as alternatives.

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?

It explains that the tool accepts raw RCC parameters or friendly keys, but does not state when to use this tool versus clock_get, clock_resolve, or clock_param_possible_values. There are no explicit exclusions or prerequisites.

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

Deploy Server

Other Tools