Skip to main content
Glama

execute_prolog

Submit Prolog facts and rules with a query to obtain reasoning results. Supports CLP(FD) constraints, negation-as-failure, and standard SWI-Prolog features.

Instructions

Execute Prolog code and return reasoning results.

Write Prolog facts and rules, then run a query against them. Supports CLP(FD) constraints, negation-as-failure, and all standard SWI-Prolog features.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prolog_codeYesProlog code (facts and rules).
queryYesProlog query to execute (e.g. "mortal(X)").
rule_basesNoNames of previously saved rule bases to include. Rules are prepended to ``prolog_code`` in the specified order. Use this for domain-specific rules (e.g. game mechanics, legal rules) that should be reused across queries.
max_resultsNoMaximum number of results (prevents infinite loops).
traceNoWhen True, include structured proof trees per solution in metadata.proof_trace. Adds meta-interpreter overhead; opt-in.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

No annotations provided, so description must carry full burden. It mentions supported features (CLP(FD), etc.) but omits behavioral traits such as side effects, safety, error handling, or permissions. As an execution tool, it should disclose whether it modifies state or is read-only.

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?

Three concise sentences, each serving a distinct purpose: purpose, usage, and capabilities. No wasted words; front-loaded with key information.

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 complexity (5 params, output schema exists), description is largely complete for the core function. It does not mention the rule_bases parameter or trace behavior, but these are well-documented in the schema. With output schema present, return values are covered.

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 100%, so description adds some value by summarizing supported Prolog features, which is relevant to the prolog_code and query parameters. However, it does not elaborate on parameter semantics beyond what the schema already provides.

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?

Description clearly states the verb (execute) and resource (Prolog code) and result (reasoning results). It distinguishes from sibling tools which manage rule bases, making the purpose unambiguous.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool vs. siblings (e.g., save_rule_base, delete_rule_base). The description does not mention alternatives or provide pre/post conditions, leaving the agent to infer context from sibling names.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rikarazome/prolog-reasoner'

If you have feedback or need assistance with the MCP directory API, please join our Discord server