Use shell completers to suggest valid values to agents

Open
#1,895 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
43/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

Start with lib/complete.ts and read the linked cli-first-mcp design and tasks, especially tasks 5.1 and 5.2; inspect the per-command tool validation and existing shell completion tests. Trace how completions use the SQLite cache and live API before adding ranked candidates to validation errors and static choices to generated schemas. Done when the shell completion tests pass unchanged and the specified validation tests cover slugs, issue IDs, dataset fields and aggregates, and query keys and values.

Written by the indexing model from the issue text.

Description

CLI enhancement MCP

Part of #1357. Plan: cli-first-mcp tasks 5.1 and 5.2 (design, tasks). Depends on #1890.

Why

Agents get slugs, IDs, fields, and query keys wrong. The shell completion system already knows valid values. With no search_sentry tool to host a complete mode, completions reach agents through the per-command tools themselves.

Scope

  • Split the completers in lib/complete.ts into completers over a data source: the SQLite cache with a live API fallback on stdio, the live API uncached on hosted.
  • When a per-command tool gets an invalid or unknown value (org/project slug, issue ID, dataset field or aggregate, query key or value), return the error with ranked candidates and their descriptions so the agent can retry.
  • Put static choices (enum-like flag values) into the tool schema as examples at catalog generation time.

Done when

  • Shell completion tests pass unchanged.
  • Tests for slugs, issue IDs, dataset fields and aggregates, and query keys and values in validation errors.

via @BYK.

--

View Session in Sentry

Dominant language
TypeScript
Stars
961
Forks
179
Avg merge
15h 33m
Merged PRs (30d)
476

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/toolkit

All issues in getsentry/toolkit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.