Skip to content

WIP generate chat ID and capture that ID with subsequent tool calls #54

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

Closed
wants to merge 4 commits into from

Conversation

nelsonwittwer
Copy link
Contributor

Problem

We need a way of tracking how long it takes for an agent to generate valid code blocks with our validation tooling.

Solution

This introduces an optional conversationId param for all dev-mcp tool calls. If a user has opted out of instrumentation, this will never be passed back to Shopify.

Why this is needed

What we care most about is ensuring code blocks generated by LLMs using our MCP server don't have hallucinated error in them. If it takes a slower response (an agent taking a few iterations to get there) that is a trade off we are happy to make. We expect users to accept code blocks that interact with Shopify APIs to just work ™️ . Ideally we get to this point in as few agent loops as possible. In a perfect world, the agent is able to generate code blocks passing our validation criteria on its first try.

To get to that first try, we will need to know how far off we are to that goal and where we are falling short with our tools. Tracking chats is how we will determine how many loops it took to get all code blocks to pass our validation tools.

@nelsonwittwer nelsonwittwer requested a review from a team as a code owner July 1, 2025 14:37
@nelsonwittwer nelsonwittwer changed the title generate chat ID and capture that ID with subsequent tool calls WIP generate chat ID and capture that ID with subsequent tool calls Jul 1, 2025
Copy link
Contributor

@matteodepalo matteodepalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments, but curious to run some evals for this conversationId approach, it seems interesting!

It takes two arguments: query and filter. The query argument is the string search term to filter schema elements by name. The filter argument is an array of strings to filter results to show specific sections.`,
⚠️ REQUIRES CONVERSATION ID: You must call get_started first to get a conversationId.

Any GraphQL codeblocks generated after using this tool MUST be validated with the validate_admin_api_codeblocks tool.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line seems out of place for the introspect_admin_schema tool, is there something I'm missing?

It takes one argument: prompt, which is the search query for Shopify documentation.`,
⚠️ REQUIRES CONVERSATION ID: You must call get_started first to get a conversationId.

Chunked docs have the advantage of being able to match tokens within smaller chunks of content, but they may miss all context from a particular page of documentation. Use this tool if you want as much context for the token as possible across all of Shopify docs. Do not use this tool if you are looking for all doc context for a particular API resource -- use the fetch_entire_doc_by_path tool instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use this tool if you want as much context for the token as possible across all of Shopify docs. Do not use this tool if you are looking for all doc context for a particular API resource -- use the fetch_entire_doc_by_path tool instead.

I think this explanation is a bit cofusing to me and it might be to the LLM as well. Maybe we can rephrase it to Use this tool if you want to search across all the shopify docs and get a list of chunks that match the search. Do not use this tool if you want to retrieve a specific page from the docs.

@@ -80,13 +109,23 @@ export async function shopifyTools(server: McpServer): Promise<void> {
"fetch_docs_by_path",
`Use this tool to retrieve a list of documents from shopify.dev.

⚠️ REQUIRES CONVERSATION ID: You must call get_started first to get a conversationId.

This tool provides the full documentation for a particular path. No context will be missing for a particular path that you might miss when using doc chunks.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No context will be missing for a particular path that you might miss when using doc chunks.
A bit confusing to include this imho, it should suffice to say that this tool will return the full docs for a path.

@matteodepalo matteodepalo changed the base branch from shopify-dev-requests to main July 9, 2025 10:57
@Arkham Arkham changed the base branch from main to shopify-dev-requests July 9, 2025 11:03
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