Skip to main content
Glama

subscribe

Set up a persistent watch for new AI tools matching a query. Receive daily notifications via email or webhook.

Instructions

Set up a persistent watch for new AI tools matching a query. Get notified daily when something new appears in the Unfragile graph. Requires at least one notification channel (email or webhook).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesWhat to watch for (e.g., 'new MCP server for Postgres', 'framework for building AI agents')
typeNoOnly watch for this artifact type
emailNoEmail address for notifications
webhookNoWebhook URL for notifications (receives POST with new matches)

Implementation Reference

  • src/index.ts:763-765 (registration)
    Tool registration comment indicating this is Tool 9: Subscribe — create a monitor
    );
    
    // Tool 9: Subscribe — create a monitor
  • Full implementation of the 'subscribe' tool: registers with server.tool(), defines input schema (query, type, email, webhook), validates at least one notification channel, POSTs to /api/v1/monitor, and returns monitor details including ID, query, type filter, frequency, and expiration.
    // Tool 9: Subscribe — create a monitor
    server.tool(
      "subscribe",
      "Set up a persistent watch for new AI tools matching a query. Get notified daily when something new appears in the Unfragile graph. Requires at least one notification channel (email or webhook).",
      {
        query: z.string().min(2).max(500).describe("What to watch for (e.g., 'new MCP server for Postgres', 'framework for building AI agents')"),
        type: z.enum(["agent", "api", "app", "benchmark", "cli", "dataset", "extension", "finetune", "framework", "mcp", "model", "platform", "product", "prompt", "repo", "skill", "template", "webapp", "workflow"]).optional().describe("Only watch for this artifact type"),
        email: z.string().email().optional().describe("Email address for notifications"),
        webhook: z.string().url().optional().describe("Webhook URL for notifications (receives POST with new matches)"),
      },
      async ({ query, type, email, webhook }) => {
        log("subscribe", query);
    
        if (!email && !webhook) {
          return {
            content: [{ type: "text" as const, text: "Error: At least one notification channel required. Provide 'email' and/or 'webhook'." }],
            isError: true,
          };
        }
    
        try {
          const headers: Record<string, string> = { "Content-Type": "application/json" };
          if (API_KEY) headers["X-API-Key"] = API_KEY;
    
          const body: Record<string, unknown> = {
            query,
            notify: { email, webhook },
            source: SOURCE,
          };
          if (type) body.type = type;
    
          const controller = new AbortController();
          const timeout = setTimeout(() => controller.abort(), 15_000);
    
          try {
            const res = await fetch(`${API_BASE}/api/v1/monitor`, {
              method: "POST",
              headers,
              body: JSON.stringify(body),
              signal: controller.signal,
            });
    
            const data = await res.json();
    
            if (!res.ok) {
              throw new Error(data.error || `API error ${res.status}`);
            }
    
            const lines: string[] = [];
            lines.push(`# Monitor Created`);
            lines.push(`**ID:** ${data.id}`);
            lines.push(`**Watching for:** ${data.query}`);
            if (data.typeFilter) lines.push(`**Type filter:** ${data.typeFilter}`);
            lines.push(`**Frequency:** Daily`);
            if (email) lines.push(`**Email alerts:** ${email}`);
            if (webhook) lines.push(`**Webhook:** ${webhook}`);
            lines.push(`**Expires:** ${data.expiresAt.slice(0, 10)} (90 days)`);
            lines.push(`\n_Save the monitor ID to unsubscribe later._`);
    
            return { content: [{ type: "text" as const, text: lines.join("\n") }] };
          } finally {
            clearTimeout(timeout);
          }
        } catch (err) {
          return {
            content: [{ type: "text" as const, text: `Error creating monitor: ${err instanceof Error ? err.message : String(err)}` }],
            isError: true,
          };
        }
      }
  • Input schema using Zod: query (string 2-500 chars), type (optional enum of artifact types), email (optional email string), webhook (optional URL string)
    {
      query: z.string().min(2).max(500).describe("What to watch for (e.g., 'new MCP server for Postgres', 'framework for building AI agents')"),
      type: z.enum(["agent", "api", "app", "benchmark", "cli", "dataset", "extension", "finetune", "framework", "mcp", "model", "platform", "product", "prompt", "repo", "skill", "template", "webapp", "workflow"]).optional().describe("Only watch for this artifact type"),
      email: z.string().email().optional().describe("Email address for notifications"),
      webhook: z.string().url().optional().describe("Webhook URL for notifications (receives POST with new matches)"),
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses persistence, daily frequency, and channel requirements, but does not explain behavior when no new tools are found, or details about subscription lifetime or modification. It is adequate but not exhaustive.

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 consists of two concise sentences with no wasted words. It front-loads the core action and then provides key constraints. Every sentence serves a purpose.

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 no output schema and no annotations, the description is fairly complete: it specifies the tool's purpose, prerequisites, and notification cadence. It could be enhanced with details about subscription lifecycle or modification, but is sufficient for an agent to understand the tool's role.

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%, and the schema already describes all parameters well. The description adds context that at least one notification channel is required, reinforcing the schema. It does not add significant meaning beyond the schema, so a baseline score of 3 is appropriate.

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 specific verbs ('set up a persistent watch') and identifies the resource ('new AI tools matching a query') and context ('Unfragile graph'). It clearly distinguishes from sibling tools like 'unsubscribe' (reverse) and 'search' (one-time).

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

Usage Guidelines4/5

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

The description states that daily notifications are sent and that at least one notification channel is required. It provides clear context for when to use the tool, but does not explicitly mention when not to use it or compare to alternatives like 'find_mcps'.

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/Savirinc/unfragile-mcp-server'

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