Skip to content

tailnet_status: add filters and a compact summary mode so large tailnets don't flood agent context #57

Open

Description

@TMHSDigital

Why it matters

tailnet_status returns every peer with every field, pretty-printed (JSON.stringify(data, null, 2) in src/tools/helpers.ts:10). On a modest homelab that's fine. On a tailnet with dozens or hundreds of nodes, or with shared-in and Mullvad exit nodes, which can add hundreds of entries, a single "is my raspi online?" question burns thousands of context tokens. generate_ssh_config and ping_all then ask for the same full status again. Agents work best with tools that let them ask narrow questions.

Evidence

Suggested approach

  • Add filters to tailnet_status: query (case-insensitive substring over hostname/dnsName/IP), tags, os, exitNodeOptionsOnly, includeShared/includeMullvad (default false), and limit.
  • Add fields: "summary" | "full". The default summary (hostname, dnsName, ipv4, online) keeps the payload small.
  • Emit compact JSON in the text block once structuredContent lands (Migrate to registerTool with annotations, titles, and structured output (roadmap 0.2.0) #39); the structured channel carries the full shape.
  • Reuse the same filter object in ping_all and generate_ssh_config (for example, "ping only my tag:server nodes").

Done when

"Is raspi online?" can be answered with a response under ~300 bytes on a 200-node tailnet, the filters are shared across the three tools, and tests cover each filter.

Activity

  1. added
    enhancement
    priority: P2
    on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority: P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions