Skip to main content
Glama

list_watches

List active webhook watches associated with your TensorFeed token. Identify which event listeners are currently configured for real-time AI industry alerts.

Instructions

List the active webhook watches owned by the configured TensorFeed token. Free, requires TENSORFEED_TOKEN.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The list_watches tool handler: fetches watches from /premium/watches endpoint, formats them into a readable text output, or returns 'No active watches.' if count is 0.
    server.tool(
      'list_watches',
      'List the active webhook watches owned by the configured TensorFeed token. Free, requires TENSORFEED_TOKEN.',
      {},
      async () => {
        const data = (await fetchJSON('/premium/watches', { auth: true })) as {
          count: number;
          watches: {
            id: string;
            spec: { type: string; model?: string; field?: string; op?: string; threshold?: number; provider?: string; value?: string };
            callback_url: string;
            fire_count: number;
            fire_cap: number;
            expires_at: string;
            status: string;
          }[];
        };
        if (data.count === 0) {
          return { content: [{ type: 'text' as const, text: 'No active watches.' }] };
        }
        const rows = data.watches
          .map(w => {
            const desc =
              w.spec.type === 'price'
                ? `${w.spec.model} ${w.spec.field} ${w.spec.op}${w.spec.threshold !== undefined ? ' ' + w.spec.threshold : ''}`
                : `${w.spec.provider} ${w.spec.op}${w.spec.value ? ' ' + w.spec.value : ''}`;
            return `  ${w.id} (${w.status}) [${w.spec.type}] ${desc}\n     -> ${w.callback_url}\n     fired ${w.fire_count}/${w.fire_cap}, expires ${w.expires_at}`;
          })
          .join('\n\n');
        return { content: [{ type: 'text' as const, text: `${data.count} active watches:\n\n${rows}` }] };
      },
    );
  • The tool is registered via server.tool('list_watches', ...) on the McpServer instance. Registration includes the tool name, description, empty schema (no parameters), and the handler function.
    server.tool(
      'list_watches',
      'List the active webhook watches owned by the configured TensorFeed token. Free, requires TENSORFEED_TOKEN.',
      {},
      async () => {
        const data = (await fetchJSON('/premium/watches', { auth: true })) as {
          count: number;
          watches: {
            id: string;
            spec: { type: string; model?: string; field?: string; op?: string; threshold?: number; provider?: string; value?: string };
            callback_url: string;
            fire_count: number;
            fire_cap: number;
            expires_at: string;
            status: string;
          }[];
        };
        if (data.count === 0) {
          return { content: [{ type: 'text' as const, text: 'No active watches.' }] };
        }
        const rows = data.watches
          .map(w => {
            const desc =
              w.spec.type === 'price'
                ? `${w.spec.model} ${w.spec.field} ${w.spec.op}${w.spec.threshold !== undefined ? ' ' + w.spec.threshold : ''}`
                : `${w.spec.provider} ${w.spec.op}${w.spec.value ? ' ' + w.spec.value : ''}`;
            return `  ${w.id} (${w.status}) [${w.spec.type}] ${desc}\n     -> ${w.callback_url}\n     fired ${w.fire_count}/${w.fire_cap}, expires ${w.expires_at}`;
          })
          .join('\n\n');
        return { content: [{ type: 'text' as const, text: `${data.count} active watches:\n\n${rows}` }] };
      },
    );
  • The schema for list_watches is an empty object {}, meaning the tool takes no input parameters.
    {},
  • The fetchJSON helper function is used by the list_watches handler to make authenticated API calls to the TensorFeed API.
    async function fetchJSON(path: string, opts: FetchOptions = {}): Promise<unknown> {
      const headers: Record<string, string> = {
        'User-Agent': `TensorFeed-MCP/${SDK_VERSION}`,
      };
      if (opts.body !== undefined) headers['Content-Type'] = 'application/json';
      if (opts.auth) {
        const token = process.env.TENSORFEED_TOKEN;
        if (!token) {
          throw new Error(
            'TENSORFEED_TOKEN env var is not set. Premium MCP tools require a bearer token. ' +
              'Buy credits at https://tensorfeed.ai/developers/agent-payments and pass the returned tf_live_... token via the TENSORFEED_TOKEN env var in your MCP client config.',
          );
        }
        headers['Authorization'] = `Bearer ${token}`;
      }
      const res = await fetch(`${API_BASE}${path}`, {
        method: opts.method ?? 'GET',
        headers,
        ...(opts.body !== undefined ? { body: JSON.stringify(opts.body) } : {}),
      });
      if (!res.ok) {
        let errPayload: unknown;
        try {
          errPayload = await res.json();
        } catch {
          errPayload = await res.text().catch(() => '');
        }
        if (res.status === 402) {
          throw new Error(
            `Payment required (402). Your token may be out of credits. Top up at https://tensorfeed.ai/developers/agent-payments. Detail: ${JSON.stringify(errPayload)}`,
          );
        }
        if (res.status === 401) {
          throw new Error(
            `Token rejected (401). Check that TENSORFEED_TOKEN is set to a valid tf_live_... token. Detail: ${JSON.stringify(errPayload)}`,
          );
        }
        throw new Error(`API error ${res.status}: ${JSON.stringify(errPayload)}`);
      }
      return res.json();
    }
Behavior4/5

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

With no annotations, the description covers cost ('Free') and authentication requirement. For a simple list tool with no side effects, this is adequate transparency. No contradiction with annotations as none exist.

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 two concise sentences, front-loaded with the action. Every word serves a purpose, with no redundancy.

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 has zero parameters, no output schema, and is a simple list operation, the description fully covers what the agent needs to know: action, scope, auth, and cost. Complete in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no parameters, so parameter description is not needed. The description does not add any parameter info, but schema coverage is 100%, and baseline for zero parameters is 4.

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 lists active webhook watches, distinguishing it from create/delete siblings. Uses specific verb 'List' and identifies the resource (watches) and ownership (token).

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 mentions authentication via TENSORFEED_TOKEN and that it's free. Though it doesn't explicitly state when not to use, sibling names imply alternative create/delete tools, providing sufficient context.

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/RipperMercs/tensorfeed'

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