Skip to content

Add lightweight query results function that returns only work item IDs #663

@VSshw

Description

@VSshw

Summary: The existing wit_get_query_results_by_id function returns complete work item details, which creates large payloads when queries have many work items. We need a lightweight alternative that returns only work item IDs.

Current Behavior:

  • wit_get_query_results_by_id returns full query results with all work item details
  • Large queries result in excessive data transfer and slow response times
  • Large queries result overwhelms the LLM (Language Learning Model) with too much context
  • Unnecessary data is included when users only need work item IDs for further processing

Proposed Solution: Add a new function wit_get_query_ids_by_id with these characteristics:

Function Name: wit_get_query_ids_by_id

Description: "Retrieve only the work item IDs from a query result. This is a lightweight alternative to get_query_results_by_id when you only need the IDs."

Parameters:

  • id (required): The query ID
  • project (optional): Project name or ID
  • team (optional): Team name or ID
  • timePrecision (optional): Include time precision
  • top (optional): Maximum number of results (default: 50)

Return Format:

{
  "ids": [12345, 67890, 11111],
  "count": 3
}

Benefits:

  • Significantly reduced response payload size
  • Faster query execution and data transfer
  • Prevents LLM context window overflow with large result sets
  • IDs can be used directly with wit_get_work_items_batch_by_ids for selective detail retrieval
  • Maintains backward compatibility (original function unchanged)

Implementation: The function calls the same API as wit_get_query_results_by_id but extracts only the IDs from queryResult.workItems array.

Instead of returning full details for potentially hundreds of work items, return just the array of IDs for efficient processing by AI assistants and other tools.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions