Skip to main content
Glama

Run Python AST & Contrast Verification Suite

ink_run_python_tests
Read-onlyIdempotent

Run Python-powered static analysis, contrast ratio calculations, and headless layout audits to obtain structured verification metrics.

Instructions

PURPOSE: Execute the external Python verification suite for deep AST static analysis, mathematical contrast matrix calculation, and headless layout audits.

BEHAVIOR: Spawns the local Python 3 ink_verifier engine in a sandboxed subprocess. Purely read-only; does not mutate source files or modify disk state unless 'capture' is specifically invoked. Requires Python 3.10+ installed in the environment PATH. Returns comprehensive structured test metrics.

USAGE GUIDELINES:

  • When to use: Use when running deep multi-pass Python AST analysis, mathematical APCA/WCAG contrast calculation, or comprehensive verification across an entire codebase.

  • When NOT to use: Do NOT use for fast in-memory CSS validation without Python (use ink_validate_design instead) or for standalone client-side security audits (use ink_audit_security instead).

  • Alternatives: Use ink_validate_design for fast TypeScript-native design verification; use ink_audit_security for native security scanning.

RETURNS: ResultEnvelope containing structured test outcomes from the Python verifier engine according to the invoked action ('contrast', 'security', 'visual', 'audit', 'full', 'bidi', 'inspect', or 'capture').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoSource code snippet to analyze with Python AST and regex engines (required when action is 'security', 'visual', 'audit', 'bidi', or 'full')
actionNoVerification action: 'contrast' (WCAG/APCA matrix calculation), 'security' (Python AST sink linter), 'visual' (anti-slop rule engine), 'audit' (combined static analysis), 'full' (all static + dynamic checks), 'bidi' (RTL/LTR logical property AST analysis), 'inspect' (reverse-engineer URL design), 'capture' (headless browser multi-viewport snapshots)full
targetNoWebsite URL or local HTML file path (required when action is 'inspect' or 'capture')
backgroundHexNoBackground surface color in 6-digit hex (used when action is 'contrast')
foregroundHexNoForeground text color in 6-digit hex (used when action is 'contrast')

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesDomain-specific typed payload returned by the tool
statusYesExecution outcome status
summaryYesConcise, human-readable executive summary of the tool outcome
evidenceNoAudit trail, source references, and generated artifact locations
warningsYesOperational cautions, craft advice, or non-blocking warnings
nextActionsNoActionable sequential recommendations or subsequent tool suggestions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.2.0

TDQS

A3.7/5.0
Behavior1/5

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

Annotation Contradiction: annotations declare readOnlyHint=true, but the description states that the tool 'does not mutate source files or modify disk state unless 'capture' is specifically invoked.' This explicitly opens a path to disk modification, contradicting the read-only annotation. The description also discloses useful environmental details (Python 3.10+, sandboxed subprocess), but the contradiction forces a score of 1.

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 well-structured with clear PURPOSE, BEHAVIOR, USAGE GUIDELINES, and RETURNS headings, and the purpose is front-loaded. It is somewhat longer than necessary because the alternatives are named twice and the action list is repeated from the schema, but the organization makes it easy to scan and each section earns its place.

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?

Given the tool's complexity (5 parameters, 8 enum values, conditional requirements) and the presence of a rich output schema, the description is largely complete: it covers environment dependencies, sandboxing, read-only behavior, when to use vs. alternatives, and return structure. The only completeness gap is rooted in the read-only/capture contradiction, which is already penalized under behavioral transparency.

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 parameter meanings are already fully documented in the schema. The description adds some contextual framing by explaining that returned outcomes depend on the invoked action)Skip and by repeating conditional use cases, but it does not add meaning beyond what the schema already provides. Baseline 3 is appropriate.

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?

The description clearly states a specific verb ('Execute'), a specific resource (the Python ink_verifier suite), and the exact scope: deep AST static analysis, contrast matrix calculation, and headless layout audits. It also names the sibling alternatives it is not, so an agent can distinguish it from ink_validate_design and ink_audit_security without inspecting 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 Guidelines5/5

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

The description provides explicit when-to-use guidance for deep Python AST analysis, explicit when-NOT-to-use guidance for fast CSS validation and client-side security audits, and names the alternative sibling tools. This is exactly the kind of decision routing an agent needs.

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