Skip to content

Improve AI agent usability across all MCP tools#14

Open
lucasjahn wants to merge 3 commits intoGeLi2001:mainfrom
lucasjahn:feat/ai-agent-tool-improvements
Open

Improve AI agent usability across all MCP tools#14
lucasjahn wants to merge 3 commits intoGeLi2001:mainfrom
lucasjahn:feat/ai-agent-tool-improvements

Conversation

@lucasjahn
Copy link
Copy Markdown
Contributor

Problem

When an AI agent/LLM consumed this MCP toolset autonomously, it hits several friction points that cause unnecessary round-trips, context bloat, and outright errors:

  1. Response bloat: Every GET tool returns all fields by default. An agent asking "what's the product title?" gets back variants, media, SEO, collections, and more — flooding its context window.
  2. Blind pagination: No way to know how many results exist before fetching.
  3. Inconsistent ID formats: Some tools expect numeric IDs, others expect full GIDs, but descriptions didn't clarify which.
  4. Missing cross-tool references: e.g. create-fulfillment requires a fulfillmentOrderId but nothing told the agent to call get-fulfillment-orders first.
  5. Unsafe defaults: Customer notification params could send real emails/SMS without user confirmation.
  6. Free-text where enums exist: inventory-set-quantities.reason accepted any string but Shopify rejects invalid values.
  7. No bulk tag operations: Tagging 50 resources required 50 sequential calls.

Solution

Iterative improvements driven by a consumer AI agent auditing all 45 tools.

  • Field selection (fields param) on all GET tools — fetch only what you need
  • Count-only mode (countOnly) on list tools — { count: N } without data
  • Bulk tag management — new manage-tags-bulk for up to 100 resources
  • Description consistency — ID format examples, cross-tool hints, metafield upsert semantics, notification safety warnings
  • Correctness — reason enum with 17 valid Shopify values
  • README — updated from 31 to 45 tools with new sections

All changes are backwards compatible. No new dependencies.

List tools (orders, products, customers, collections) now accept an
optional 'fields' parameter to select which fields the GraphQL query
returns, reducing context pollution when only IDs or specific data is
needed. Max page size raised from 10-100 to 250 (Shopify API limit).

Affected tools: get-orders, get-products, get-customers,
get-collections, get-customer-orders
Make descriptions more assertive so AI agents actually use the fields
parameter instead of fetching all data. Descriptions now tell agents
to always specify fields, and to ask the user which fields are needed
when unsure rather than defaulting to all fields.
… and bulk tags

Driven by iterative feedback from an AI consumer agent testing all 45 tools,
this addresses the main friction points when an LLM operates the MCP toolset
without human guidance.

Field selection & countOnly:
- Add `fields` param to all GET tools (products, orders, customers, collections,
  metafields, variants) so agents fetch only the data they need
- Add `countOnly` param to list tools (get-products, get-orders, get-customers,
  get-customer-orders) to size result sets before paginating
- Increase max page size from 50 to 250 on list endpoints

Bulk tag management:
- Add manage-tags-bulk tool for batch add/remove on up to 100 resources

Description clarity & consistency:
- Add format examples to all ID params (GID vs numeric, with examples)
- Add cross-tool navigation hints (e.g. create-fulfillment references
  get-fulfillment-orders for obtaining required IDs)
- Add metafield upsert semantics to all update tools
- Add customer notification safety warnings requiring user confirmation
- Change inventory-set-quantities reason from free text to validated enum

Collection improvements:
- Add field selection to get-collection-by-id

README:
- Update tool count from 31 to 45
- Document new sections: Collections, Configuration, Enhanced Order,
  Inventory & Pricing, shared field selection and countOnly capabilities
@GeLi2001
Copy link
Copy Markdown
Owner

GeLi2001 commented Apr 5, 2026

hi @lucasjahn thanks for the PR, I found there's merge conflicts after #13 got merged, can you sync with origin main again? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants