List of Values Filtering: Natural Language Replaces UI Controls

James Phoenix
James Phoenix

Instead of sidebar filters and dropdowns, give the model a List of Values (LOV) for tool parameters and let natural language do the filtering.

Source: Alpic – 15 Lessons Building ChatGPT Apps

The Problem

Traditional dashboards are built on sidebars full of checkboxes, range sliders, and dropdowns. Porting these into agentic interfaces adds friction. When users can express intent directly (“sunny destinations in Europe for under $200”), forcing them through multiple UI controls is a regression.

The model also “guesses” when it doesn’t know what valid options exist, leading to hallucinated filter values that don’t match your backend’s API.

The Solution

Provide a List of Values (LOV) as tool parameter enums. The model maps natural language directly to your backend’s requirements.

Leanpub Book

Read The Meta-Engineer

A practical book on building autonomous AI systems with Claude Code, context engineering, verification loops, and production harnesses.

Continuously updated
Claude Code + agentic systems
View Book
// Tool definition with LOV
{
  name: "search_destinations",
  parameters: {
    weather: {
      type: "string",
      enum: ["sunny", "mild", "cold", "tropical", "any"],
      description: "Weather preference for the destination"
    },
    region: {
      type: "string",
      enum: ["europe", "asia", "americas", "africa", "oceania"],
      description: "Geographic region"
    },
    budget: {
      type: "string",
      enum: ["budget", "mid-range", "luxury"],
      description: "Price tier"
    }
  }
}

User says “sunny” and the model knows to call the tool with weather="sunny". No dropdown needed. No hallucinated values.

Why This Works

  1. Constrains the model: Enum values prevent hallucinated parameters
  2. Removes UI friction: Users state intent naturally instead of clicking through controls
  3. Maps to backend contracts: LOV values match exactly what your API accepts
  4. Reduces token waste: No need to load complex UI state into context

When to Use LOV vs Traditional Filters

Scenario LOV Traditional UI
Agentic chat interface Yes No
Complex multi-faceted filtering Yes (multiple LOV params) Consider for visual exploration
Exact value selection from small set Yes Also fine
Continuous ranges (price $0-$500) Bucket into tiers Slider works better visually
Visual comparison (color picker, map) No Yes

Related Concept: Context Asymmetry

The same team identified a key principle: not all context should be shared between the user, UI, and model. Each body in the system (user, widget, model) may need intentionally different views of the same state.

Field Purpose Visible to
structuredContent Typed data for widget and model Both
_meta Response metadata Widget only, hidden from model

This applies to LOV too. The model needs the enum values to route correctly. The UI might display richer labels or icons. The user sees natural language. Each participant gets the view they need.

Related

Topics
Ai AgentsApi DesignContext EngineeringData EngineeringRAG

Newsletter

Become a better AI engineer

Weekly deep dives on production AI systems, context engineering, and the patterns that compound. No fluff, no tutorials. Just what works.

Join 306K+ developers. No spam. Unsubscribe anytime.


More Insights

Cover Image for AI Eats Cliché, Not Complexity

AI Eats Cliché, Not Complexity

Most software is not being eaten because it is simple. It is being eaten because it has been built ten thousand times before, and every one of those builds is sitting in the training data. Complexity was never the fault line. Originality is.

James Phoenix
James Phoenix
Cover Image for How to Automate Agentic Engineering Failure-Mode Detection in the SDLC

How to Automate Agentic Engineering Failure-Mode Detection in the SDLC

**Every engineer running Claude Code is already writing a diary of where the SDLC breaks**: every stalled task, every abandoned plan, every loop they gave up on and finished by hand. Nobody uses that diary, because using it means a human reads a colleague’s session, and that is a trust violation no team will accept. Here is how to turn that diary into a working pipeline anyway, without a single person ever reading a transcript.

James Phoenix
James Phoenix