Repository navigation
Split the wide generated diagrams into subVIs and remove overlaps - #45
Merged
Merged
Conversation
The three public VIs were generated as single diagrams 2,500 to 3,300 px wide, which users open when they want to see how progress, cancellation and elicitation work. They are now built on small private subVIs, and their diagrams are 750 to 1,400 px wide. Connector panes, defaults, descriptions and behaviour are unchanged. New in Private/SubVIs: - Read Request Context: reads the "MCP Request Context" queue element of the running request and says whether there is one. - Register Input Request: queues an elicitation/create question on "MCP Input Requests". - Read Stream State: whether the call is cancelled (stored state, stream closed or legacy notifications/cancelled), the last progress and probe. - Write Stream State: stores key, last progress, cancelled and probe; does nothing outside a streamed call. - Build Progress Event: builds the notifications/progress event text. - Send Stream Event: queues one SSE event, waits up to 1 s for the stream to take it and reports whether the client is gone. Get Request Stream now uses Read Request Context. Cancel Requested writes the stream state on every streamed call instead of only on a change; the stored content is the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both private VIs were generated as tangled diagrams 2,200 and 3,800 px wide. They are now built on named subVIs and laid out: 770 and 1,280 px. Connector panes and behaviour are unchanged; Run Streamed Request and its new subVIs are reentrant, so concurrent streams do not wait for each other. New in Private/SubVIs: - Build Stream Object: the stream object handed to the SSE response. - Stream Was Cancelled: after the handler returns, whether the stream was cancelled (flag queue, stream state or legacy cancellation). - Finish Stream: sends the final data event and the end marker, waits up to 5 s for the stream to take them and releases both queues. - Read Server Info: serverInfo, _meta and capabilities from initialize. - Build Discover Response: the server/discover result. - Add Result Fields: resultType, the serverInfo _meta and cache hints. - Remap Resource Not Found: -32002 becomes -32602 for resources/read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….vim Select Value.vim was a loose malleable VI, not a member of MCP Server.lvlib, used once in Process HTTP Request to choose between two objects of the same class. LabVIEW's Select function does the same, so the .vim is gone and is no longer installed as a loose file in vi.lib. The diagram had nodes stacked on top of each other in three places (the client-access header reads, the streaming nodes, the Mcp-Method/Mcp-Name reads) and Set Header drawn over a case structure. They are moved apart; nothing else in the VI changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Objects drawn on top of each other since the recent changes: - Start: the Allowed clients and Access token terminals and Server Access Settings. - Add Tool: the title and annotations terminals now sit on the left with the other inputs; a constant was lying on wires. - Add Prompt: Check MCP Names, an error ring, Select and Or overlapped. - Get Connector Pane Info: a subVI sat on a case structure's border. Objects were only moved; the code is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests✅ All 64 tests passed. Per-test results
Protocol tests✅ Protocol tester output (0 failed required checks)VI changesVIs: 11 modified, 18 added, 1 deleted 5 more modified VIsAdded VIs (18)Deleted: Report for commit ee7ee96. The installable test package is under Artifacts of this run once the build job has finished. |
The package build failed in VIPM ("The VI is not in memory", error 1004
on Complete Modern MCP Result). The VIs rebuilt by script on this branch
were listed in MCP Server.lvlib but did not record their owning library
themselves, so VIPM's rename step could not find them; three of them also
carried LabVIEW's "insane items" save flag. All of them are now written
by LabVIEW itself, record MCP Server.lvlib, and none has the flag.
Diagrams that were still tangled are tidied with LabVIEW's Clean Up
Diagram, and the busiest ones are split further. Cancel Requested, Ask
User and Process HTTP Request keep their earlier layout, which reads
better than Clean Up's.
New in Private/SubVIs:
- Complete Handler Result: completes the handler's response, either
with Add Result Fields or with Remap Resource Not Found.
- Input Required Response: the input_required response of a tool call
that waits for elicitation answers.
- Response Status Code: 202 for a notification without response,
otherwise 200.
- Add Cache Hints: ttlMs and cacheScope for lists and resources/read.
- Should Send Progress: whether Report Progress sends an event.
Behaviour, connector panes, reentrancy and error handling settings are
unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Update: new commit
🤖 Generated with Claude Code |
JanGoebel
marked this pull request as ready for review
October 25, 2026 16:45
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.





























Summary
The VIs generated since v3.0.0 had block diagrams 2,200 to 3,800 px wide and tangled, four hand-drawn diagrams had objects on top of each other, and
Select Value.vimwas installed as a loose file outside the library. The wide VIs are now built on named private subVIs, the overlaps are moved apart, and the.vimis replaced by LabVIEW's Select function. Behaviour and every connector pane are unchanged.Changes
Public VIs, rebuilt on subVIs (connector panes, defaults and descriptions identical):
Report Progress.vi,Cancel Requested.vi(modified): use Get Request Stream, Read/Write Stream State, Build Progress Event and Send Stream Event; Report Progress also Should Send Progress. Cancel Requested now writes the stream state on every streamed call instead of only on a change; the stored content is the same.Ask User.vi(modified): uses Read Request Context and Register Input Request; the registration is in a case frame labelled "Register the question".Private VIs, rebuilt on subVIs:
Run Streamed Request.vi(modified): uses Build Stream Object, Stream Was Cancelled, Finish Stream. Reentrant as before.Complete Modern MCP Result.vi(modified): uses Read Server Info, Build Discover Response, Complete Handler Result, Input Required Response and Response Status Code.Get Request Stream.vi(modified): uses Read Request Context.New private subVIs (Private/SubVIs, LabVIEW 20.0, icon from
New-VIIcon.ps1, VI description):Read Request Context.vi: the running request's "MCP Request Context" queue element, and whether there is one.Register Input Request.vi: queues anelicitation/createquestion.Read Stream State.vi: cancelled? (stored state, stream closed or legacy cancel), last progress, last probe.Write Stream State.vi: stores the stream state; does nothing outside a streamed call.Build Progress Event.vi: thenotifications/progressevent text.Send Stream Event.vi: queues one SSE event, waits up to 1 s for the stream to take it, reports whether the client is gone.Build Stream Object.vi: the stream object for the SSE response.Stream Was Cancelled.vi: after the handler returns, whether the stream was cancelled.Finish Stream.vi: final data event and end marker, waits up to 5 s, releases both queues.Read Server Info.vi: serverInfo,_metaand capabilities from initialize.Build Discover Response.vi: theserver/discoverresult.Add Result Fields.vi:resultType, serverInfo_metaand cache hints.Remap Resource Not Found.vi: -32002 becomes -32602 forresources/read.Complete Handler Result.vi: completes the handler's response with Add Result Fields, or with Remap Resource Not Found when there is no result.Input Required Response.vi: theinput_requiredresponse of a tool call waiting for elicitation answers.Response Status Code.vi: 202 for a notification without a response, otherwise 200.Add Cache Hints.vi:ttlMsandcacheScopefor lists andresources/read.Should Send Progress.vi: whether Report Progress sends an event.The generated diagrams are laid out with LabVIEW's Clean Up Diagram where that reads better; Cancel Requested, Ask User and Process HTTP Request keep their earlier layout, which reads better than Clean Up's.
Moves only (no code change):
Start.vi: Allowed clients / Access token terminals and Server Access Settings no longer overlap.Add Tool.vi: title and annotations terminals moved left with the other inputs; a constant moved off the wires.Add Prompt.vi: Check MCP Names, the error ring, Select and Or moved apart.Get Connector Pane Info.vi: a subVI moved off a case structure's border.Process HTTP Request and Select Value.vim:
Process HTTP Request.vi(modified): theSelect Value.vimcall is replaced by the Select function; nodes stacked in three places and Set Header drawn over a case structure are moved apart.Select Value.vim(deleted): it was not a library member and had no other caller.MCP Server.lvlib(modified): the 18 new subVIs added to Private/SubVIs.Code summary
Report Progress.viCancel Requested.viAsk User.viGet Request Stream.viRead Request Context.viRegister Input Request.vielicitation/createquestion on "MCP Input Requests"Read Stream State.viWrite Stream State.viBuild Progress Event.vinotifications/progressevent text, with total and message only when setSend Stream Event.viShould Send Progress.viComplete Modern MCP Result.viComplete Handler Result.viAdd Result Fields.viresultType, the serverInfo_metaand cache hintsAdd Cache Hints.vittlMsandcacheScopefor lists andresources/readRemap Resource Not Found.viresources/readRead Server Info.vi_metaand capabilities from initializeBuild Discover Response.viserver/discoverresultInput Required Response.viinput_requiredresponse of a tool call waiting for elicitation answersResponse Status Code.viRun Streamed Request.viBuild Stream Object.viStream Was Cancelled.viFinish Stream.viProcess HTTP Request.viStart.viAdd Tool.viAdd Prompt.viGet Connector Pane Info.viSelect Value.vimReport Progress.vi— modifiedSame behaviour, now built on six named subVIs; the diagram was 3266 px wide and is now about 830 px.
Get Request Streamfinds the stream of the running request, as before.Read Stream Statereads whether the call is cancelled (stored state, stream closed or legacynotifications/cancelled), the last progress sent and the last probe.Should Send Progressdecides whether this call sends a progress event at all.Build Progress Eventbuilds thenotifications/progressevent text fromprogress,totalandmessage.Send Stream Eventqueues the event, waits up to 1 s for the stream to take it and reports whether the client is gone.Write Stream Statestores the updated stream state; outside a streamed call it does nothing.Cancel Requested.vi— modifiedSame answer, built on the same subVIs as Report Progress; the diagram went from 2921 to about 740 px.
Get Request Streamfinds the stream of the running request.Read Stream Statesays whether the call is already cancelled and when the stream was last probed.Send Stream Eventsends thekeep-alive commentas a probe and reports whether the client is gone.Write Stream Statenow stores the stream state on every streamed call, not only when it changed. What is stored is the same as before.Ask User.vi— modifiedSame behaviour; the request context read and the question registration are now subVIs, and the diagram went from 2540 to 1381 px.
Read Request Contextreads the running request's "MCP Request Context" queue element and says whether there is one. It replaces the Obtain Queue / Preview Queue Element / Release Queue chain.Register Input Requestqueues theelicitation/createquestion on "MCP Input Requests". Before, the schema check and the enqueue were about twenty nodes inline.Get Request Stream.vi— modifiedThe queue read at the start is now done by Read Request Context; the JSON lookups of the stream fields are unchanged, and the diagram shrinks from 1380 to 831 px.
Before:
error outwas, and still is,error inpassed through.After:
Read Request Context.vigives the context text of the running request; the same lookups ($.stream,$.events,$.cancelled,$.id,$.progressToken) read it as before.Read Request Context.vi— addedReads the "MCP Request Context" queue element of the running request and says whether there is one; used by Get Request Stream and Ask User.
error inpasses straight toerror out.found?is true only if the preview did not time out and there was no error.Register Input Request.vi— addedQueues an
elicitation/createquestion on "MCP Input Requests"; used by Ask User.requestedSchemaif it is not empty and is a JSON object, otherwise the confirmation schema{"type":"object","properties":{}}.{<key>:{"method":"elicitation/create","params":{"mode":"form","message":<message>,"requestedSchema":<schema>}}}, with key and message JSON-encoded.error out.Read Stream State.vi— addedReads the stored state of the streamed call: whether it is cancelled, the last progress sent and the last probe; used by Report Progress and Cancel Requested.
Stream State.vi.cancelledqueue with no wait: the stream was closed.stream keyis not empty and the stored$.keyequals it.$.cancelledequal totrue,$.lastas a number (NaN if it is not a JSON number) and$.probeas U32. The False frame returns not cancelled, NaN and 0.cancelled?is the stored flag, or the closed stream, or a legacynotifications/cancelledfromLegacy Cancellations.vi.Write Stream State.vi— addedStores the stream state of a streamed call; its True frame (empty
stream key, not a streamed call) only passes the error through. The False frame:lastis the progress as JSON, ornullwhile it is NaN.cancelledis written astrueorfalse.{"key":…,"last":…,"cancelled":…,"probe":…}is joined and stored withStream State.vi(store = true).Build Progress Event.vi— addedBuilds the text of one
notifications/progressSSE event; used by Report Progress.data: {"jsonrpc":"2.0","method":"notifications/progress","params":{"progressToken":, then the token and,"progress":with the JSON number.,"total":is added only iftotalis not NaN and greater than 0.,"message":is added only ifmessageis not empty.}}.Send Stream Event.vi— addedQueues one SSE event and reports whether the client is gone; with
send?false (False frame) it sends nothing and returnsclient gone?false. The True frame:eventsqueue.Wait For Stream Drain.viwaits up to 1 s for the stream to take it; its errors are cleared.client gone?is true if the stream did not take the event in time.Should Send Progress.vi— addedDecides whether Report Progress sends a progress event.
send?also needs a streamed call (streaming?).Complete Modern MCP Result.vi— modifiedThe whole diagram was one generated block 3,770 px wide; it is now about 990 px, built on five named subVIs. The three Selects on the right choose the final response from their outputs, as before.
Read Server Info.viruns initialize internally and returns serverInfo, its_metaand the capabilities.Build Discover Response.vibuilds theserver/discoverresult from them.Complete Handler Result.vicompletes the handler's response: result fields and cache hints, or the remapped "resource not found" error.Input Required Response.vibuilds theinput_requiredresponse of a tool call that waits for elicitation answers, and says whether that applies.Response Status Code.vigives 202 for a notification without a response, otherwise 200.Complete Handler Result.vi— addedCompletes the handler's response: with Add Result Fields when it has a result, otherwise with Remap Resource Not Found.
$.resultin the handler response; whether it is there decides which of the two outputs the Select passes on.resultType, the serverInfo_metaand cache hints.resources/read"not found" error (-32002) to -32602.Add Result Fields.vi— addedAdds
resultType, the serverInfo_metaand the cache hints to a result.$.result.resultTypeto"complete"._meta: when the result already has_meta, the serverInfo entry is set inside it; otherwise a new_metaobject holding it is set. The Select picks between the two.Add Cache Hints.viaddsttlMsandcacheScopefor the methods that get them.Add Cache Hints.vi— addedAdds
ttlMsandcacheScopeto the result of list methods andresources/read.Cache Hints.vigives the hints for this method and whether there are any.ttlMs(as a decimal number) andcacheScope(as a JSON string) are set in$.result.Remap Resource Not Found.vi— addedFor
resources/read, turns the "resource not found" error code -32002 into -32602 (invalid params).$.error.codeand compares it with -32002.resources/read; both checks must be true.$.error.codeto -32602. The Select passes this on only when both checks are true; otherwise the response is unchanged.Read Server Info.vi— addedReads serverInfo, its
_metaand the capabilities from the server's own initialize answer.initializerequest (protocol 2025-11-25, client "Handle MCP Request").read?is true; the visible False frame passes the emptyno initializetext instead.capabilities,serverInfo.nameandserverInfo.versionfrom the answer and buildsserverInfoand the_metaobject holding it.The True frame:
initialize.vianswers the request.Build Discover Response.vi— addedBuilds the
server/discoverresult as one JSON text.supportedVersions: the list fromSupported Protocol Versions.vi, as JSON.ttlMsandcacheScopefromCache Hints.viforserver/discover.resultType: "complete", the versions, capabilities,_metaand the cache hints.Input Required Response.vi— addedBuilds the
input_requiredresponse of a tool call that waits for elicitation answers.input required?is true when the method istools/calland there are input requests.resultType: "input_required", theinputRequestsand_metainto the response.Response Status Code.vi— addedThe HTTP status of the answer.
Run Streamed Request.vi— modifiedThe generated diagram was 2,216 px wide; it is now 770 px, built on three named subVIs. It stays reentrant, so concurrent streams do not wait for each other.
Build Stream Object.vibuilds the stream object handed to the SSE response from the two queues.Stream Was Cancelled.vichecks, after the handler returns, whether the stream was cancelled. If so, the Select passes the emptyno responsetext to Finish Stream instead of the handler's response.Finish Stream.visends the final data event and the end marker, waits for the stream to take them and releases both queues.Build Stream Object.vi— addedBuilds the stream object
{"events":…,"cancelled":…}from the two queue references.Stream Was Cancelled.vi— addedAfter the handler returns: was the stream cancelled? Any one of three signs is enough.
cancelledflag queue, previewed without waiting.keymatches this stream and itscancelledistrue.notifications/cancelledfor this request's id, fromLegacy Cancellations.vi.cancelled?.Finish Stream.vi— addedEnds the SSE stream: final data event, end marker, wait, release.
The response with CR and LF removed, as one
data:event.When the response is empty, the visible True frame sends nothing. The False frame enqueues the event on
events:Enqueues the end marker, waits up to 5 s for the stream to take it (
Wait For Stream Drain.vi) and releases both queues.Process HTTP Request.vi— modifiedThe
Select Value.vimcall is replaced by LabVIEW's Select function, and nodes that were drawn on top of each other are moved apart; nothing else changes.Select Value.vim, a loose malleable VI outside the library, used only here to choose between two objects of the same class. New: the Select function does the same, so the.vimis deleted.Get Request,Get Client URIand theAuthorizationheader read were stacked on and around Validate HTTP Request. They now have their own place at the top left, withGet Hostnext toGet Client URI.Mcp-MethodandMcp-Nameheader reads were stacked on each other. They now stand side by side.Create MCP SSE Response,Prepare Request Dispatch,Start Streamed Request) were hidden under other objects and do not show in the before picture at all. They now sit to the left of the case structure.Set Headerwas drawn over the case structure. It now sits to the left of it.Start.vi— modifiedObjects moved only; the code is unchanged.
Allowed clientsandAccess tokenterminals lay on top of each other and underServer Access Settings. They now sit side by side above it, each with its label readable.Add Tool.vi— modifiedObjects moved only; the code is unchanged.
titleandannotationsterminals sat far below the diagram. They now sit on the left with the other inputs.kindconstant lay on wires. It now sits in a free spot below them.Add Prompt.vi— modifiedObjects moved only; the code is unchanged.
Check MCP Namescalls, the error ring, Select and Or overlapped. They now stand apart in one row, with the error ring below them.Get Connector Pane Info.vi— modifiedObjects moved only; the code is unchanged.
Add Control Details To Schemasat on the bottom border of the "Array" case structure. It now sits below the structure.Select Value.vim— deletedA loose malleable VI outside
MCP Server.lvlib, used only in Process HTTP Request; it is replaced there by LabVIEW's Select function.Verified
All in LabVIEW 2026 64-bit on this machine, on the final files:
tests\Run_Tests_CLI.vithrough LabVIEW CLI): 64 of 64 tests passed, exit code 0.vipm buildin LabVIEW 2020 64-bit from a clean worktree of ee7ee96, as the test-build job does: built in 265 s. The first CI test build of this PR failed with VIPM error 1004 ("The VI is not in memory"): 15 VIs rebuilt by script were listed in the library but did not record their owning library themselves. LabVIEW now writes that link in all of them (checked in every.viofsrc/MCP Server).tests\Run_Protocol_Tests_CLI.vi): 24 of 24 required checks passed, 0 advisory failures.Run Streamed Request.vihad lost its reentrant setting, soOpen VI Referencewith option 8 failed and every streamed call ended at once. Setting it reentrant again made all 64 pass.MCP Server.lvlib, no "insane items" save flag, own icon in the toolkit style (read from the files). Public connector panes compared withmain: identical.main: identical for Report Progress, Cancel Requested, Add Tool, Add Prompt, Start, Process HTTP Request and Get Connector Pane Info. Automatic error handling is off on all new subVIs, as on the VIs they came from.Not verified
Known rough edges
🤖 Generated with Claude Code