Untitled conversation
- User
[Image: image/png]
- User
can we create an option for an AI bot to exclude data? See:
Assistant
I can see the issue - the query results are dominated by readings from bGeigie-2113 in Cork (an anomalous source), and there's no way to exclude specific devices from the results.
Let me first read the screenshot to see the full context, then explore the codebase to understand how we can add device exclusion capabilities.
Assistant
Now let me check if other tools have device filtering patterns we can follow:
Assistant
Yes! I can add an
exclude_devicesparameter to thequery_extreme_readingstool. This will allow AI bots (and users) to filter out anomalous sources like bGeigie-2113. Here's what I'll do:- User
[Request interrupted by user]
- User
Exclude devices and exclude cities and areas?
Assistant
Great idea! Let's expand this to support excluding devices, cities/areas, or both. I'll update the todos:
Assistant
Let me check how to define array parameters in the MCP tool definition:
Assistant
Perfect! The library supports
WithArray. Now I'll implement the exclusion features:Assistant
Now let me update the handler to use these exclusion parameters:
Assistant
Let me fix the array parameter access:
Assistant
Perfect! I can use
GetStringSlice. Let me fix the code:Assistant
Let me verify the code compiles:
Assistant
Now I'll update the documentation to include the exclusion parameters:
Assistant
Now let me update the REST API endpoint to support the exclusion parameters:
Assistant
Let me fix the argument setting:
Assistant
Perfect! I've successfully implemented device and area exclusion for the
query_extreme_readingstool. Here's what was added:Changes Made
1. MCP Tool Parameters (tool_extreme_readings.go)
- Added
exclude_devicesparameter - accepts an array of device IDs to filter out - Added
exclude_areasparameter - accepts JSON array of bounding boxes to exclude - Updated SQL query builder to apply both exclusion types
2. REST API Support (rest_extreme.go)
- Added
exclude_devicesquery parameter (comma-separated list)
- Added
- User
Did yo commit?
Assistant
No, I haven't committed yet. Let me do that now:
Assistant
Yes! Commit created successfully:
d3fe71d feat: add device and area exclusion to query_extreme_readingsThe commit includes:
- README.md - Updated documentation with examples
- tool_extreme_readings.go - MCP tool with exclusion logic
- rest_extreme.go - REST API support for exclusions
The remaining uncommitted file (
go/mcp-server) is just the compiled binary, which is a build artifact and doesn't need to be committed.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.