Skip to main content
Glama

vigile_timeline

Fetch a security timeline for an incident or topic from Vigile memory.

Instructions

Fetch a security timeline for an incident or topic from Vigile memory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicNoTopic selector for timeline lookup
incident_idNoIncident ID selector (preferred when known)

Implementation Reference

  • The `timelineMemory` function is the core handler for the vigile_timeline tool. It accepts a baseUrl, apiKey, and selector (topic or incident_id), calls the Vigile API at /api/v1/memory/timeline, and returns a formatted timeline string with events, confidence, and provenance info.
    export async function timelineMemory(
      baseUrl: string,
      apiKey: string,
      selector: { topic?: string; incident_id?: string },
    ): Promise<string> {
      const body: Record<string, string> = {};
      if (selector.incident_id) {
        body.incident_id = selector.incident_id;
      } else if (selector.topic) {
        body.topic = selector.topic;
      } else {
        return "timeline requires either topic or incident_id.";
      }
    
      const { ok, status, data } = await fetchVigile(baseUrl, apiKey, "/api/v1/memory/timeline", {
        method: "POST",
        body: JSON.stringify(body),
      });
    
      if (!ok) {
        if (status === 403 && data?.detail?.error === "memory_timeline_upgrade_required") {
          return [
            "Memory timeline requires a Pro plan or above.",
            `Current tier: ${data?.detail?.current_tier || "unknown"}`,
          ].join("\n");
        }
        return `Memory timeline failed: ${data?.detail?.message || data?.detail || `HTTP ${status}`}`;
      }
    
      const events = Array.isArray(data?.events) ? data.events : [];
      const lines = [
        `## Memory Timeline: ${data?.selector || body.incident_id || body.topic}`,
        "",
        data?.answer_context || "No timeline context returned.",
        "",
        `Confidence: ${typeof data?.confidence === "number" ? data.confidence.toFixed(2) : "0.00"}`,
        `Provenance Complete: ${Boolean(data?.provenance_complete)}`,
        "",
        "### Events",
      ];
    
      if (!events.length) {
        lines.push("No timeline events returned.");
      } else {
        for (const event of events) {
          lines.push(
            `- ${event.timestamp} | ${event.event_type} | ${event.summary} | source: ${event.source_id}`
          );
        }
      }
      return lines.join("\n");
    }
  • The tool registration with schema definitions for vigile_timeline. Uses zod schemas: 'topic' (optional string, 2-200 chars) and 'incident_id' (optional string, 2-120 chars).
    server.tool(
      "vigile_timeline",
      "Fetch a security timeline for an incident or topic from Vigile memory.",
      {
        topic: z.string().min(2).max(200).optional().describe("Topic selector for timeline lookup"),
        incident_id: z.string().min(2).max(120).optional().describe("Incident ID selector (preferred when known)"),
      },
      async ({ topic, incident_id }) => {
        const result = await timelineMemory(API_BASE, API_KEY, { topic, incident_id });
        return { content: [{ type: "text" as const, text: result }] };
      }
    );
  • src/index.ts:150-161 (registration)
    The `server.tool()` call that registers the tool with the name "vigile_timeline" and wires it to the timelineMemory handler.
    server.tool(
      "vigile_timeline",
      "Fetch a security timeline for an incident or topic from Vigile memory.",
      {
        topic: z.string().min(2).max(200).optional().describe("Topic selector for timeline lookup"),
        incident_id: z.string().min(2).max(120).optional().describe("Incident ID selector (preferred when known)"),
      },
      async ({ topic, incident_id }) => {
        const result = await timelineMemory(API_BASE, API_KEY, { topic, incident_id });
        return { content: [{ type: "text" as const, text: result }] };
      }
    );
  • The `fetchVigile` helper function used by timelineMemory to make HTTP requests to the Vigile API. Handles authentication, error sanitization, and response parsing.
    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 },
        };
      }
    }
Behavior2/5

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

With no annotations, the description carries full burden for behavioral traits. It only indicates a read operation ('fetch'), but lacks details on idempotency, authentication, rate limits, error handling, or behavior when both parameters are provided.

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

Conciseness4/5

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

The description is a single sentence with no extraneous words. It is concise, though it could benefit from additional structure like bullet points or a note on parameter selection.

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

Completeness2/5

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

Given the absence of output schema and annotations, the description is insufficient. It does not explain the return format, pagination, error scenarios, or how to choose between topic and incident_id. The sibling tools have diverse purposes, but the description does not help the agent decide when to use this specific tool.

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?

The input schema has 100% description coverage for both parameters. The description only paraphrases the schema ('incident or topic') without adding extra meaning, such as specificity on format, interactions between parameters, or default behavior.

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?

The description clearly states the verb 'Fetch' and the resource 'security timeline for an incident or topic from Vigile memory'. It references the two parameters in the schema. However, it does not explicitly differentiate from sibling tools like vigile_search, which may also fetch security data.

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 the siblings. It does not mention prerequisites, when not to use, or alternative tools for similar tasks.

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