Skip to main content
Glama
CHASE MCP Server

CHASE MCP Server

by chase-cps

parse_c

Read-onlyIdempotent

Reads C source text or file to extract per-function contracts (requires/ensures) from ESBMC, CBMC, or ACSL annotations, enabling contract checking and composition.

Instructions

Read the contracts written in a C file (text or a file path), one per function: the clauses of ESBMC (__ESBMC_requires, __ESBMC_ensures in the body), of CBMC (__CPROVER_requires, __CPROVER_ensures after the signature), or of ACSL (/*@ requires ...; ensures ...; */). The inputs are the parameters, the outputs FUNCTION_out (the return value) and the pointers written (*p is p). A function with no clause has a contract with no terms: check_c checks it for overflow, division by zero, and the like.

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": "parse_c"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNo
textNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the safe-read profile (readOnlyHint, idempotentHint, openWorldHint=false), and the description adds genuinely non-derived behavior: the output convention (FUNCTION_out for the return value, *p for written pointers), the inputs-as-parameters convention, and the edge case that a clause-less function yields an empty contract rather than an error. It does not say how parse failures or malformed clauses are reported, which is the remaining gap.

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 core purpose is front-loaded in the first clause and the size matches the amount of information conveyed. Sentences are dense and slightly run-on (the long parenthetical enumerating dialect keywords), but every sentence carries substance.

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?

With no output schema, the description accepts the burden of describing returns and does so via FUNCTION_out and the *p convention. For a two-parameter read-only parser it is nearly sufficient; missing only error/failure semantics and the path-vs-text precedence rule.

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 0%, so the description must compensate. It does name both inputs ('text or a file path'), but neither schema property is described, and it never says whether one is required, what happens if both are supplied, or which wins — a real ambiguity given both default to null and required is empty.

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?

States a specific verb and resource ('Read the contracts written in a C file') and enumerates the three supported annotation dialects (ESBMC, CBMC, ACSL), which tells an agent immediately this is the C-specific parser among the parse_* siblings. It stops short of explicitly naming parse_smv/parse_sva/parse_spec as the alternatives, so differentiation is implied by language rather than stated.

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?

Usage is only implied: the note that 'check_c checks it for overflow, division by zero, and the like' sketches the downstream workflow, hinting when this tool is the right entry point. There is no explicit 'use this when' clause and no exclusion against the other parse_* tools or against going straight to check_c.

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