glean-tool-selection

A set of always-active rules for choosing the right Glean search tool for different questions. Glean is a company search system that can search sources such as documents, email, meetings, and code.

In plain words
What is it for?
Use it to route document, email, meeting, code, activity, people, and multi-source questions, and to ensure results include links for verification.
Why use it?
It prevents people and questions from being sent to the wrong search method, which can produce incomplete or misleading results.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/gleanwork/cursor-plugins/glean-tool-selection
Clone the repo
git clone --depth 1 https://github.com/gleanwork/cursor-plugins
Per session 288 This file is loaded in full into every session.
When invoked 288 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00288 $0.00288
Opus 5 $0.00144 $0.00144
Sonnet 5 $0.00058 $0.00058
Haiku 4.5 $0.00029 $0.00029

Measured yesterday against content hash a5d611f54039, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

glean-tool-selection scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

glean/rules/glean-tool-selection.mdc · 24 lines

What it actually says

Glean Tool Selection

When Glean MCP tools are available (tools matching mcp__glean_*), use the correct tool for each query type:

  • People queries ("who works on", "who owns", org chart) → employee_search (NEVER use search for people)
  • Meeting queries (decisions, action items, transcripts) → meeting_lookup with natural language dates
  • Email queries (messages, attachments) → gmail_search
  • Code queries (implementations, patterns, commits) → code_search
  • Activity queries ("what have I done", standup prep) → user_activity
  • Document queries (policies, specs, wikis) → search
  • Full document contentread_document with URL from search results
  • Complex multi-source analysischat

Key rules:

  • Use search with structured parameters (separate owner, app, updated arguments)
  • Use code_search, employee_search, gmail_search with inline query filters
  • Use meeting_lookup with natural language dates (inline date filters are unreliable)
  • Always cite sources with URLs so users can verify
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 24 lines · 288 tokens per session scan A a5d611f54039

Subscribe to this mod's changes

glean-tool-selection is a cursor rule published in the GitHub repository gleanwork/cursor-plugins (3 stars, last pushed 12d ago), licensed MIT. It adds 288 tokens to every session, about $0.0014 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.