Skip to main content
Glama

Truth Table

truth_table
Read-onlyIdempotent

Generate a complete truth table for boolean expressions (and, or, not, xor, implies, iff), returning each variable assignment, result, row count, satisfiability, and tautology.

Instructions

Build the truth table for a boolean expression over and/or/not/xor/ implies/iff (plus true/false constants and variables): 'a and b or not c', 'p xor q', 'a implies b'. Use z3_check, not this, for satisfiability over inequalities or non-boolean variables; use evaluate_expression for symbolic (non-boolean) math.

Returns variables (sorted names) and rows (one dict per assignment, each variable name -> bool plus result), plus row_count, satisfiable (any row true), and tautology (every row true).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesBoolean logic expression to tabulate, e.g. 'a and b or not c', 'p xor q', 'a implies b'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.12.0
    • addedInput schema / properties / expression / description
      Added value: +"Boolean logic expression to tabulate, e.g. 'a and b or not c', 'p xor q', 'a implies b'"
  2. Changed1 schema field changedv0.11.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "truth_tableDictOutput",
      +  "type": "object"
      +}
  3. Changed4 schema fields changedv0.2.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / expression / title
      Added value: +"Expression"
    • addedInput schema / title
      Added value: +"truth_tableArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  4. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, covering the safety profile. The description adds value by specifying the output shape (variables, rows with each variable plus result, row_count, satisfiable, tautology) and the meaning of the summary booleans, which are not stated in the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences: a clear definition with examples, an explicit when-not-to-use, and a compact rundown of the return fields. Every sentence earns its place; there is no filler or redundancy with the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that only accepts one expression string and has an output schema, the description fully covers what an agent needs: domain of valid input, the output object's semantics, and routing to similarly named tools. The return value and the meaning of satisfiable/tautology are explicitly explained, so nothing essential is left out.

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

Parameters4/5

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

The schema has 100% coverage and describes the expression parameter with examples, so the baseline is 3. The description goes further by defining the grammar of accepted expressions (allowed operators, true/false constants, variables) and reinforcing with examples, which adds meaning beyond the schema's one-line description.

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 uses a specific verb-resource pairing, 'Build the truth table for a boolean expression', and enumerates the supported operators (and/or/not/xor/implies/iff) with three concrete examples. It also explicitly names sibling tools it is not, differentiating itself from z3_check and evaluate_expression at a glance.

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 gives explicit usage exclusions: 'Use z3_check, not this, for satisfiability over inequalities or non-boolean variables; use evaluate_expression for symbolic (non-boolean) math.' This directly instructs when to avoid the tool and directs the agent to the correct sibling in those cases, going beyond vague contextual hints.

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