glim-mcp
${var} — the research question or task, e.g.
what are people saying about MCP servers this weekorpull the top HN + Reddit takes on <topic>. Append--deepfor a wider sweep. Required. If empty, logGLIM_NO_QUERYand exit cleanly (no notify).
Answer one research question with live data through the glim.sh MCP server (glim.sh/mcp): web search, full-page extraction, and platform-native access to X/Twitter, Reddit, GitHub, Amazon, and YouTube transcripts. Every call draws from the operator's prepaid glim balance — spend is real, so the sweep is bounded.
Detection & auth
The server is wired by the dashboard MCP panel's one-click Connect (OAuth with offline_access; tokens stored as MCP_GLIM_TOKEN + MCP_GLIM_OAUTH, refreshed each run by scripts/mcp-oauth-refresh.sh). Its tools surface as mcp__glim__* — discover them from the server; the tool descriptions are the source of truth, don't assume a fixed list.
- No
mcp__glim__*tool callable → the server isn't connected (or its secrets are missing, in which case the workflow logged a::warning::and skipped MCP). LogGLIM_NOT_CONNECTED, notify once pointing the operator at the dashboard → MCP → Connect glim.sh, and exit. - Tools exist but return 401/invalid-token → the OAuth refresh failed (see
docs/mcp-oauth.md). LogGLIM_AUTH_STALE, notify the operator to re-connect the server once in the dashboard, and exit. - Payment-required / insufficient-balance errors → log
GLIM_NO_BALANCE, notify the operator to top up their glim account, and exit with whatever partial results already came back (clearly marked partial).
Steps
1. Plan the sweep
Parse ${var} into 2–4 sub-questions and pick the glim tools that fit each — platform tools (X, Reddit, GitHub, YouTube, Amazon) when the question names a platform or the answer obviously lives there; web search + page extraction otherwise. Don't fan out for its own sake: a question one search answers gets one search.
Spend budget: ≤ 10 tool calls per run, ≤ 25 with --deep. Count as you go; when the budget is spent, synthesize from what's in hand rather than making "one more" call. This is a hard cap (STRATEGY: stay within configured spend limits).