Skip to main content
Glama

BRAINIAC Source Code Structure & Correctness Checks

Detect concurrency hazards

code_concurrency-hazard-detect

Flag potential race and shared-state hazards in caller-supplied source using deterministic pattern matches for async/concurrency markers, shared globals, and TOCTOU-shaped spans. The code is not executed. Price $0.04 USDC. POST /api/v1/code/concurrency-hazard-detect. Unpaid calls return 402 and do not run.

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": {
      "files": "<files>"
    },
    "name": "code_concurrency-hazard-detect"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description does real work: it discloses that analysis is deterministic pattern matching, the code is never executed, the price is $0.04 USDC, and unpaid calls return 402 without running. It still omits practical traits such as output shape, supported language coverage beyond the schema enum, and any rate or size 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?

Front-loaded with what is detected and how, then commercial and access details in short statements. Every sentence carries information, though the price and endpoint line reads more like boilerplate than guidance.

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?

There is no output schema, so the description should indicate what a 'flag' looks like, but it does not. The behavioral and payment disclosures are solid for a single-parameter tool, yet the missing result shape and undocumented nested input leave real gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the required files array carries nested path/source/language fields plus size limits, yet the description only alludes to 'caller-supplied source'. It adds no meaning about the files structure, language values, batch limits, or per-file constraints, so it fails to compensate for the coverage gap.

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 specific verb and resource: flag race and shared-state hazards in caller-supplied source. It names the concrete signal types (async/concurrency markers, shared globals, TOCTOU-shaped spans), which distinguishes it from siblings like change-coupling or maintainability analysis without needing their schemas.

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

Usage Guidelines3/5

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

The description implies the use case (static concurrency review of supplied code, nothing executed) but never states when to choose this over a sibling such as the error-propagation audit or when it is inappropriate. Usage is inferable rather than explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources