Skip to main content
Glama
sbd-toe-mcp
by SbD-ToE

Prepare SbD-ToE Grounded Codegen Context

prepare_sbd_toe_codegen_context
Read-only

Assembles citable, deterministic security context from declared risks, concerns, technologies, and files for code generation, review, or test planning—without writing or changing code.

Instructions

ASSEMBLES CONTEXT, DOES NOT ACT: writes, changes and validates no code — it gathers deterministic, citable context for YOU to generate, review or plan tests. Declare the context (risk_level, concerns, exposure, data_sensitivity, technologies, changed_files, or chapters/categories); the task is recorded, not interpreted. Statuses: ready_for_codegen, needs_clarification, needs_decomposition (batches that sum to the whole), needs_input, unsupported_scope. Ready: one FUSED object per requirement (id, name, type, description, verify, evidence), citations, adjacency, instructions, size_estimate.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "prepare_sbd_toe_codegen_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoDefaults to 'codegen'. Changes llm_codegen_instructions flavor.
taskNoConcrete task to ground (e.g. 'Add payload validation to PATCH /users/:id/email'). Required.
debugNoWhen true, includes rejected_candidates and trace notes in the output.
stackNoFree-text stack hint (e.g. 'Node.js/Express'). Informational only at WP5.
detailNoResponse level. lista: every activated requirement verbatim (id, name, type, description, verify, evidence) + citations + instructions/template; grounding and relations by reference; adjacency summary. standard: lista + adjacency detail. full (default): standard + manual_grounding, relations_ref, trace; no envelope, price in size_estimate. lista fits 8,450 tokens, standard 9,200, measured on the real payload; above, needs_decomposition with measured batches that sum to the whole; a single category that alone does not fit is served ready, declared irreducible. 'ultrathin'/'minimal' retired.
chaptersNo0.21 §6 — FORMA B (como no select): capítulos declarados (source_bundle, p.ex. "11-deploy-seguro"), verificados contra o catálogo. Só no caminho declarativo.
concernsNoConcerns DECLARADOS. Conjunto FECHADO de 24 valores, gerado do mesmo vocabulário que sbd://toe/activation-vocabulary publica (com o que cada valor activa e quantos requisitos traz por nível). Valores fora do conjunto são DECLARADOS na resposta (unknown_concerns), nunca descartados em silêncio.
exposureNoApplication exposure level. Informational only at WP5.
categoriesNo0.21 §6 — FORMA B: categorias declaradas (p.ex. "AUT", "SES"). É a receita dos lotes de needs_decomposition: cada lote é a partição exacta das categorias que a tua declaração activou (technologies/changed_files/overlay preservados), medida e dentro do envelope salvo irredutível declarado, e a união dos lotes é o conjunto inteiro (m_recall 1). Só no caminho declarativo.
risk_levelNoApplication risk level. Filters runtime v0 requirements when provided.
technologiesNoTecnologias DECLARADAS do vocabulário fechado (containers, kubernetes, iac, ci-cd, sca-sbom, sast, dast, monitoring, jwt) — activam capítulos por TABELA publicada em sbd://toe/activation-vocabulary. Preferir a `stack` em texto livre.
changed_filesNoOptional file paths. Path-based heuristics may add concerns (visible in activation_trace).
selection_modeNoSemântica da SELECÇÃO (não confundir com `mode`, que é codegen/review/test-plan). declarative (default, contrato v1.18-beta): o conjunto vem do que DECLARASTE (concerns/exposure/data_sensitivity/technologies/changed_files) — sem declarações devolvo needs_input com o vocabulário; o `task` serve para grounding/citações e auditoria, não para escolher requisitos. discover: motor inferencial histórico (a prosa activa), exploratório.
slice_familiesNoContext only: activates the AppSec Core slices of these families (g2_context entities + manual_grounding) and never selects requirements; alone it returns needs_input. Not a way to ask: the server writes it into each needs_decomposition batch recipe so the batch carries the context your request activated for its categories — execute the batch's `with` as given. Published values: sbd://toe/activation-vocabulary → slice_families.
data_sensitivityNoData sensitivity level. Informational only at WP5.
include_relationsNoEscape hatch for clients that cannot make a second call. When true at detail='lista'/'standard', keeps g2_context.relations inline (dieted: no per-item source) instead of the relations_ref reference. Default false. Ignored at detail='full' (relations always inline there).
regulatory_frameworksNoOptional regulatory framework IDs or short codes (e.g. 'EXT-DORA', 'CRA'). Resolved via the overlay loader. If the overlay is absent, returns unsupported_scope.
include_regulatory_overlayNoWhen true (and overlay is published), enriches the response with regulatory_overlay context.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.22.0

TDQS

A3.9/5.0
Behavior4/5

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

The readOnlyHint annotation is reinforced rather than contradicted, and the description goes well beyond it by enumerating the five outcome statuses (ready_for_codegen, needs_clarification, needs_decomposition, needs_input, unsupported_scope) and explaining that decomposition batches sum to the whole. It also discloses the shape of the ready payload (fused requirement objects, citations, adjacency, size_estimate). It stops short of describing what the non-ready statuses carry, which matters for a tool whose main failure mode is 'needs_input'.

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 dense sentences with the most important constraint ('DOES NOT ACT') front-loaded, and no filler. Some phrasing is jargon-heavy ('one FUSED object per requirement', 'batches that sum to the whole') that costs the reader without adding precision.

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 an 18-parameter tool with no output schema, the description covers the contract (declare, don't narrate), the outcome statuses, and the ready payload well enough to call it correctly, with the schema carrying the per-parameter detail. The remaining gap is recovery guidance — what needs_input or needs_clarification actually returns and how to proceed — but that is secondary.

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 18 parameters, including the declarative vs discover selection semantics and the detail levels; the baseline of 3 applies. The description's only added meaning is that task 'is recorded, not interpreted' and a recap of the declaration parameters, which duplicates rather than extends the schema.

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 opening clause names a specific verb and resource — 'ASSEMBLES CONTEXT, DOES NOT ACT' — and states what the output is for (grounding the caller's own generation/review/planning). It clearly distinguishes the tool from code-writing tools, but never names or contrasts a sibling such as select_sbd_toe_requirements, so an agent cannot confirm from the description alone which of the two to call.

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?

It gives concrete invocation guidance: 'Declare the context (risk_level, concerns, exposure, data_sensitivity, technologies, changed_files, or chapters/categories)' and clarifies that the task 'is recorded, not interpreted', which steers the agent away from prose-driven invocation. There are no explicit exclusions or named alternatives, so the agent gets clear context but no when-not-to-use rules.

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