Skip to main content
Glama
piiiico

proof-of-commitment

query_commitment

Query a domain to retrieve verified behavioral commitment data including unique visitors, repeat visit rate, and average time spent, proving real human engagement.

Instructions

Query verified behavioral commitment data for a domain. Returns aggregated signals: unique verified visitors, repeat visit rate, and average time spent. These prove real human engagement — harder to fake than reviews or content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesThe domain to query (e.g. 'example.com'). Will be normalized to lowercase without protocol or path.

Implementation Reference

  • The 'query_commitment' tool handler function. It normalizes the domain, fetches commitment data from the backend API, computes repeat visit rate and average time, formats a summary string, and returns it both as text and as raw JSON.
    server.tool(
      "query_commitment",
      "Query verified behavioral commitment data for a domain. Returns aggregated signals: unique verified visitors, repeat visit rate, and average time spent. These prove real human engagement — harder to fake than reviews or content.",
      {
        domain: z
          .string()
          .describe(
            "The domain to query (e.g. 'example.com'). Will be normalized to lowercase without protocol or path."
          ),
      },
      async ({ domain }) => {
        const normalized = domain
          .trim()
          .toLowerCase()
          .replace(/^https?:\/\//, "")
          .split("/")[0]!;
    
        try {
          const res = await fetch(
            `${BACKEND_URL}/api/domain/${encodeURIComponent(normalized)}`
          );
    
          if (!res.ok) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `Backend error: ${res.status} ${res.statusText}`,
                },
              ],
              isError: true,
            };
          }
    
          const data = (await res.json()) as any;
    
          const repeatRate =
            data.uniqueCommitments > 0 && data.totalVisits > 0
              ? Math.round(
                  ((data.totalVisits - data.uniqueCommitments) /
                    data.totalVisits) *
                    100
                )
              : 0;
    
          const avgMinutes =
            data.avgSeconds > 0 ? Math.round(data.avgSeconds / 60) : 0;
    
          const summary =
            data.uniqueCommitments === 0
              ? `No verified commitment data for ${normalized}.`
              : [
                  `Domain: ${normalized}`,
                  `Verified unique visitors: ${data.uniqueCommitments}`,
                  `Total visits: ${data.totalVisits}`,
                  `Repeat visit rate: ${repeatRate}%`,
                  `Average time per visitor: ${avgMinutes} minutes (${Math.round(data.avgSeconds)}s)`,
                  `Total time invested: ${Math.round(data.totalSeconds / 3600)} hours`,
                  data.lastUpdated ? `Last updated: ${data.lastUpdated}` : null,
                ]
                  .filter(Boolean)
                  .join("\n");
    
          return {
            content: [
              { type: "text" as const, text: summary },
              {
                type: "text" as const,
                text: JSON.stringify(
                  { ...data, repeatRate, avgMinutes },
                  null,
                  2
                ),
              },
            ],
          };
        } catch (err) {
          const message = err instanceof Error ? err.message : "Unknown error";
          return {
            content: [
              {
                type: "text" as const,
                text: `Failed to reach backend at ${BACKEND_URL}: ${message}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • Registration of the 'query_commitment' tool via server.tool(), including its description and Zod schema for the 'domain' input parameter.
    server.tool(
      "query_commitment",
      "Query verified behavioral commitment data for a domain. Returns aggregated signals: unique verified visitors, repeat visit rate, and average time spent. These prove real human engagement — harder to fake than reviews or content.",
      {
        domain: z
          .string()
          .describe(
            "The domain to query (e.g. 'example.com'). Will be normalized to lowercase without protocol or path."
          ),
      },
  • Zod schema defining the 'domain' input parameter for query_commitment — a string that gets normalized to lowercase without protocol/path.
    {
      domain: z
        .string()
        .describe(
          "The domain to query (e.g. 'example.com'). Will be normalized to lowercase without protocol or path."
        ),
    },
Behavior2/5

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

No annotations provided, so description must disclose behavioral traits. It describes returned signals but omits details like authentication needs, rate limits, error handling for invalid domains, or whether the operation is read-only. The 'verified' claim is not explained.

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?

Two concise sentences front-loading the purpose and quickly covering outputs and value. No superfluous words; every sentence earns its place.

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

Completeness3/5

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

For a single-parameter tool with no output schema, the description covers purpose and output signals but lacks details on error cases, domain validity, rate limits, and result interpretation. Adequate for basic use but incomplete for robust agent behavior.

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% with a clear description for the domain parameter including normalization details. The tool description adds no further meaning; the schema already handles parameter semantics adequately.

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?

Clearly states the tool queries verified behavioral commitment data for a domain and lists the specific signals returned (unique verified visitors, repeat visit rate, average time spent). However, it does not explicitly differentiate from sibling tools like lookup_business or audit_dependencies, though the nature of data is distinct.

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?

No explicit when-to-use or when-not-to-use guidance. The description implies it's for behavioral data harder to fake than reviews, but does not mention alternatives or prerequisites. Usage context is only implied.

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/piiiico/proof-of-commitment'

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