-
Notifications
You must be signed in to change notification settings - Fork 13
Update MCP response to improve agent's answers #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,8 @@ func RegisterGetChunksForEmbeddings(s *mcp.Server, k8sClient *k8sclient.Client, | |
| Description: `Search for relevant text chunks in a pipeline's data product using vector cosine similarity. Returns top matching chunks for the given query. | ||
| If pipeline_name is not known, call list_unstructured_data_pipelines_for_user first and follow the instructions in its response. | ||
| If the returned chunks are not sufficient to answer the user's question, you may call get_processed_document with the same pipeline_name and the file_id from the top matching chunk to retrieve the full processed document for more context. | ||
| If no matching chunks are found, it could be because the user does not have access to the original source file — suggest they request access to it. | ||
| Always cite sources: include file_id in your answer so the user can visit the source file. For Google Drive sources, provide the URL as https://drive.google.com/file/d/<file_id>/view. | ||
| On error: report the exact error to the user and STOP. Do NOT retry with other pipelines. | ||
|
Comment on lines
+48
to
50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Make citation requirements conditional on source-bearing success responses. The current “always cite” rules conflict with error and empty-result behavior. These paths can return no verified
📍 Affects 3 files
🤖 Prompt for AI Agents |
||
| On follow-up: if the user is not satisfied, ask them which pipeline to search. Do NOT automatically try other pipelines.`, | ||
| }, func(ctx context.Context, _ *mcp.CallToolRequest, args getChunksArgs) (*mcp.CallToolResult, any, error) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use neutral guidance for empty search results.
The tools return no access-status signal. An empty result can mean no relevant match or missing source access, so the agent cannot identify access as the cause.
internal/mcp/tools/get_chunks.go#L48-L49: Present missing access as one possible cause instead of defaulting to an access request.skills/unstructured-data-mcp-skill.md#L14-L17: State the same uncertainty, correct the grammar, and capitalizeGoogle DriveandURL.📍 Affects 2 files
internal/mcp/tools/get_chunks.go#L48-L49(this comment)skills/unstructured-data-mcp-skill.md#L14-L17🤖 Prompt for AI Agents
Source: Linters/SAST tools