Skip to main content
Glama

Multi-step Hypothesis Test

test_hypothesis
Read-onlyIdempotent

Run a predefined sequence of live checks—such as endpoint reachability, npm search counts, or substring presence—to test a hypothesis and produce a clear pass/fail summary.

Instructions

Run a small verification plan made of concrete live checks and summarize whether a hypothesis is supported. Use this when one conclusion depends on multiple simple checks such as endpoint reachability, npm search counts, or whether a page contains an exact substring. This is a coordination tool, not an open-ended research agent: every test must be explicitly defined in advance. Use verify_claim when you already have evidence URLs, estimate_market for category sizing, and compare_competitors when you already know exact package names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hypothesisYesClaim to test, for example 'there are fewer than 50 MCP email servers on npm'.
testsYesOrdered list of one to ten checks to run. Each test object uses only the fields required by its type.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
hypothesisYesHypothesis that was evaluated.
testsYesPer-test execution results in input order.
verdictYesHigh-level verdict for the hypothesis.

Implementation Reference

  • The handler function for the test_hypothesis tool. Runs a multi-step verification plan: endpoint_exists (fetch URL, check 2xx), npm_count_above/npm_count_below (search npm, compare count to threshold), response_contains (fetch URL, check substring). Produces per-test results and an aggregate verdict (SUPPORTED/REFUTED/PARTIALLY SUPPORTED).
      async ({ hypothesis, tests }) => {
        const results = [];
        for (const test of tests) {
          let passed: boolean | null = null;
          let actual: string | number | null = null;
    
          try {
            switch (test.type) {
              case "endpoint_exists": {
                const resp = await fetch(test.url, {
                  headers: { "User-Agent": "GroundTruth/0.3" },
                });
                passed = resp.ok;
                actual = `status ${resp.status}`;
                break;
              }
              case "npm_count_above":
              case "npm_count_below": {
                const data = await searchNpm(sql, test.query, 1);
                const total = data.total ?? 0;
                actual = total;
                passed = test.type === "npm_count_above"
                  ? total > test.threshold
                  : total < test.threshold;
                break;
              }
              case "response_contains": {
                const { body } = await cachedFetch(sql, test.url);
                passed = body.includes(test.substring);
                actual = `${body.length} chars, contains=${passed}`;
                break;
              }
            }
          } catch (e: unknown) {
            passed = false;
            actual = e instanceof Error ? e.message : String(e);
          }
    
          results.push({
            description: test.description,
            type: test.type,
            passed,
            actual,
          });
        }
        const passedCount = results.filter(r => r.passed).length;
        logUsage("test_hypothesis", true);
        return structuredToolResult({
          hypothesis,
          tests: results as {
            description: string;
            type: "endpoint_exists" | "npm_count_above" | "npm_count_below" | "response_contains";
            passed: boolean;
            actual: string | number | null;
          }[],
          verdict: {
            passed: passedCount,
            failed: results.length - passedCount,
            summary: passedCount === results.length ? "SUPPORTED" :
                     passedCount === 0 ? "REFUTED" : "PARTIALLY SUPPORTED",
          },
        });
      }
    );
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so safety profile is clear. The description adds behavioral context beyond annotations: it is a 'coordination tool, not an open-ended research agent' and requires tests to be 'explicitly defined in advance.' This adds value but does not cover all potential nuances like error handling or rate limits.

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 extremely concise: three sentences that front-load the purpose, provide usage guidance and examples, and list alternatives. No unnecessary words.

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?

Given the tool's complexity and the existence of a detailed input schema and output schema, the description is complete. It explains the tool's nature, usage context, and differentiates from siblings. It does not need to explain return values since output schema exists.

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 baseline is 3. The description mentions the types of checks (endpoint reachability, npm search counts, substring) which are already detailed in the schema. It does not add significant new meaning beyond reinforcing that tests must be predefined.

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 the tool's purpose: 'Run a small verification plan made of concrete live checks and summarize whether a hypothesis is supported.' It gives specific verb (run/verify), resource (hypothesis), and examples of checks, while also distinguishing from siblings by naming alternatives.

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 explicitly says when to use this tool: 'when one conclusion depends on multiple simple checks' and provides concrete alternatives: 'Use verify_claim when you already have evidence URLs, estimate_market for category sizing, and compare_competitors when you already know exact package 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/anish632/ground-truth-mcp'

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