Repository navigation
Say what gpib_batch's steps are, so VS Code's Copilot will load it (#164) - #166
Merged
Merged
Conversation
Copilot refuses a tool whose schema has an array without "items", and gpib_batch's 'steps' was a bare array (#164), so in VS Code the batch tool was missing. - 'steps' now has an items schema: a step object whose 'op' is one of set/write/query/read/complete/wait, with the keys ParsePlan reads. It stays open to other keys, which are ignored as before. - 'sweep' lists its properties (var, from, to, step, count, unit). - ToolArgs gains ArrayOf and ObjectOf, and its plain-type helpers now refuse "array", so an array can't be declared without its items. - A test walks every tool's input and output schema for arrays without items. It found two more, in instrument_reference's output (commandIndex, commands), which now have items too. Fixes #164 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The regression test excludes view-only tools that are advertised to MCP Apps-capable clients.
1 open finding
What changed in this PR
Adds complete JSON schemas so strict clients can load and use gpib_batch.
Changes:
- Defines batch step and sweep schemas.
- Adds reusable array/object schema helpers.
- Adds array-item validation tests and completes output schemas.
| File | Description |
|---|---|
ToolSchemaTests.cs |
Tests schema completeness and batch shapes. |
ToolArgs.cs |
Adds structured schema helpers and array safeguards. |
DatabaseTools.cs |
Defines array item schemas for command output. |
BatchTools.cs |
Publishes detailed step and sweep schemas. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ToolsList_ReturnsAllToolsWithSchemas expects 31 tools, but manual_search is listed too whenever GPIB_MCP_MANUALS names a folder - so it failed on a PC with a library set. ManualSearchTests also sets that variable while other classes run in parallel, so it could fail in CI too. The test now clears the variable for its own call and puts it back, and it shares a collection with ManualSearchTests so the two never run at the same time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ToListJson leaves out view-only tools unless asked, but a client that shows views lists them and checks their schemas the same way. The schema walk now includes them (Copilot review on #166). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #164.
Problem
VS Code's Copilot (agent mode) refuses any tool whose schema has a
"type": "array"withoutitems:gpib_batch'sstepswas a bare array, so the batch tool, whichgpib_overviewandBatchLoopNudgesteer every sweep to, was missing in VS Code.Changes
stepsnow has anitemsschema: a step object withop(required, enumset | write | query | read | complete | wait),resource,command,value(number or string),unit,as,operation,settle_ms,timeout_ms. It keepsadditionalProperties: true, so keys it doesn't know are still ignored. At runtimeopis still matched without regard to case.sweeplists its properties:var,from,to,step,count,unit.ToolArgsgainsArrayOf(items, description)andObjectOf(description, props...), plusProp/Requiredoverloads that take a schema. The plainProp/Required(name, "array", ...)now throw, so an array can't be declared without its items again.instrument_reference'soutputSchema: the new test found two more arrays without items,commandIndexandcommands. They now have items too. (The issue thought onlystepswas affected.)Tests
New
ToolSchemaTests:inputSchemaandoutputSchema, at any depth, and asserts each array hasitemsgpib_batch's step shape and op enum, and thesweepproperties"array"The full suite passes: 644 + 117. I also checked the schema the built server publishes in
tools/list. Not yet tried in VS Code's Copilot itself.Also fixes
McpDispatcherTests.ToolsList_ReturnsAllToolsWithSchemas, which counted 32 tools rather than 31 on a PC withGPIB_MCP_MANUALSset, becausemanual_searchis listed then. BecauseManualSearchTestssets that variable while other classes run in parallel, the test could also fail in CI. The test now clears the variable for its own call and restores it, and it shares an xUnit collection withManualSearchTests. Passes with the variable set and with it clear.🤖 Generated with Claude Code