Skip to main content
Glama

vigile_check_provenance

Fetch the canonical provenance payload for a memory source ID to verify its origin and authenticity.

Instructions

Fetch canonical provenance payload for a memory source ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_idYesCanonical source identifier

Implementation Reference

  • The core handler function `checkProvenance` that executes the provenance lookup logic. It calls the Vigile API at `/api/v1/memory/sources/{sourceId}`, and returns a formatted markdown string with provenance context, source type, generation timestamp, provenance completeness flag, and the full source payload JSON.
    export async function checkProvenance(
      baseUrl: string,
      apiKey: string,
      sourceId: string,
    ): Promise<string> {
      const { ok, status, data } = await fetchVigile(
        baseUrl,
        apiKey,
        `/api/v1/memory/sources/${encodeURIComponent(sourceId)}`
      );
    
      if (!ok) {
        return `Provenance lookup failed for ${sourceId}: ${data?.detail || `HTTP ${status}`}`;
      }
    
      const source = data?.source || {};
      const lines = [
        `## Provenance: ${sourceId}`,
        "",
        data?.answer_context || "No provenance context returned.",
        "",
        `Source Type: ${source.source_type || "unknown"}`,
        `Generated At: ${source.generated_at || "unknown"}`,
        `Provenance Complete: ${Boolean(data?.provenance_complete)}`,
        "",
        "### Source Payload",
        "```json",
        JSON.stringify(source.body || {}, null, 2),
        "```",
      ];
      return lines.join("\n");
    }
  • Input schema (Zod) for the `source_id` parameter: a string of 3-128 characters describing the canonical source identifier.
      source_id: z.string().min(3).max(128).describe("Canonical source identifier"),
    },
  • src/index.ts:165-175 (registration)
    Registration of the tool `vigile_check_provenance` on the MCP server with description, schema, and handler that delegates to `checkProvenance()` from the handler module.
    server.tool(
      "vigile_check_provenance",
      "Fetch canonical provenance payload for a memory source ID.",
      {
        source_id: z.string().min(3).max(128).describe("Canonical source identifier"),
      },
      async ({ source_id }) => {
        const result = await checkProvenance(API_BASE, API_KEY, source_id);
        return { content: [{ type: "text" as const, text: result }] };
      }
    );
  • The `fetchVigile` helper used by the handler to make authenticated HTTP requests to the Vigile API. It handles authorization, error sanitization, and returns structured `{ ok, status, data }` responses.
    export async function fetchVigile(
      baseUrl: string,
      apiKey: string,
      path: string,
      options?: { method?: string; body?: string }
    ): Promise<{ ok: boolean; status: number; data: any }> {
      const headers: Record<string, string> = {
        "Content-Type": "application/json",
        "User-Agent": "vigile-mcp/0.1.7",
      };
    
      if (apiKey) {
        headers["Authorization"] = `Bearer ${apiKey}`;
      }
    
      try {
        const res = await fetch(`${baseUrl}${path}`, {
          method: options?.method || "GET",
          headers,
          body: options?.body,
        });
    
        const data = await res.json().catch(() => null);
        return { ok: res.ok, status: res.status, data };
      } catch (error: any) {
        // Sanitize error message — don't leak internal details like
        // hostnames, ports, file paths, or stack traces
        const rawMsg = error?.message || "Unknown error";
        const safeMsg = rawMsg.includes("ECONNREFUSED") || rawMsg.includes("ENOTFOUND")
          ? "API server unreachable"
          : rawMsg.includes("ETIMEDOUT") || rawMsg.includes("timeout")
          ? "Request timed out"
          : rawMsg.includes("ECONNRESET")
          ? "Connection reset"
          : "Connection failed";
        return {
          ok: false,
          status: 0,
          data: { detail: safeMsg },
        };
      }
    }
  • src/index.ts:24-24 (registration)
    Import of the `checkProvenance` function from the handler module into the main server entry point.
    import { checkProvenance } from "./tools/check-provenance.js";
Behavior2/5

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

No annotations are provided, so the description must disclose behavior. It only states 'Fetch', implying a read-only operation, but fails to mention whether it is safe, idempotent, or has side effects. No disclosure of auth needs, error conditions, or payload characteristics.

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 single-sentence description (7 words) is extremely concise and front-loaded with the key action and object. Every word adds value.

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?

Given the simplicity (1 param, no nested objects, no output schema), the description is minimally adequate but lacks information about the return value, possible errors, or constraints like source_id format beyond schema.

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?

With 100% schema description coverage (source_id is described as 'Canonical source identifier'), the description adds no additional meaning. Per guidelines, baseline is 3.

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 the specific verb 'Fetch' and clearly identifies the resource as 'canonical provenance payload' for a 'memory source ID'. It is distinct from sibling tools like vigile_check_server or vigile_recall, making its 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?

The description provides no guidance on when to use this tool versus alternatives or when not to use it. There are no mentions of prerequisites, exclusions, or context-specific recommendations.

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/Vigile-ai/vigile-mcp'

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