Tool discovery

From grandamenium/cortextos · View interactive version

Tool discovery is an AI agent skill from the GitHub repository grandamenium/cortextos. Discover, research, and CONNECT the tools a tool-agnostic personal assistant needs — email, calendar, contacts, meeting notes, messaging, CRM. CLI-first, research-driven, verified. Use during setup and whenever a workflow fails because a tool is missing or not authed.

How to use this skill

Skill file

Tool Discovery + Connect Skill

Two jobs: (1) detect what is already installed and authed, and (2) for every

domain the user names a service for, **research the right CLI, walk the user

through connecting it, and verify it actually works** — in the Telegram

conversation, on the fly.

Preference order for every domain, always: **CLI > official connector / MCP >

browser automation.** A CLI is scriptable, auditable, and does not depend on a

live browser session. Only fall back when the tier above genuinely does not exist.

Never ask for secrets in chat. Hand the user the exact auth command to run

themselves (in-session with the ! <command> prefix, or in their own terminal)

so the token lands in the tool's own secure store, not the transcript.


Step 1 — Detect what is already here

for cmd in gog gh agent-browser peekaboo sqlite3 jq rg; do
  if command -v "$cmd" >/dev/null; then echo "$cmd: $(command -v "$cmd")"; fi
done
test -f .mcp.json && cat .mcp.json
env | grep -E 'GMAIL|GOOGLE|OUTLOOK|NOTION|ZOOM|FATHOM|FIREFLIES|GRANOLA|HUBSPOT|PIPEDRIVE|AIRTABLE|CRM' | sed 's/=.*/=<configured>/'

Anything already installed AND authed: record it and skip to verify. Everything

else goes through the connect loop below.


Step 2 — The connect loop (run once per domain)

Domains the CRM assistant covers: **email, calendar, contacts, meeting notes,

messaging (e.g. iMessage), external CRM.** For each one the user says they use:

2a. Ask what service they use for this domain

"What do you use for meeting notes — Granola, Fathom, Fireflies, Zoom, something

else?" One domain at a time. Wait for the answer on Telegram.

2b. Identify the CLI (prefer CLI). Research it if you do not know it.

asking the user to do anything:

<cli> --help, <cli> auth --help.

connector. Neither -> browser automation (agent-browser / headed profile) as

the last resort, and say so plainly.

2c. Walk the user through install + auth (in chat, on the fly)

Give exact, copy-pasteable steps grounded in what you just researched:

them to type it in-session with the ! prefix, e.g.:

! gog login you@example.com

(Google opens a browser consent, stores a refresh token locally.)

where it goes (tool config, .env, or org secrets.env) — never in chat.

2d. Verify with a REAL action (do not trust presence)

Prove the connection works before moving on, with the lightest real read:

(list 1 recent email / today's events).

CLI's status/list, scoped to a safe test.

Report the result in Telegram ("Google connected — I can see your inbox and today's

calendar"). If verify fails, debug the auth with the user; do not mark it done.

2e. Record it, then loop

Append to TOOLS.md and move to the next domain.


Worked examples

! gog login <email>; verify gog auth status + list today's calendar.

the local Messages SQLite DB; verify by reading the latest message safely. No

outbound sends without the approval rule. If no clean CLI exists, say so and

propose the connector/automation fallback.

tool's CLI or export path live, walk the user through auth, verify by listing the

latest transcript.


Record Results

Append a ## Configured Tools section to TOOLS.md with, per tool:

Never write secrets to TOOLS.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.