feat(mcp): add ooxml_preset_shape tool for Annex D adjust-guide lookup#10
Open
shbernal wants to merge 1 commit into
Open
feat(mcp): add ooxml_preset_shape tool for Annex D adjust-guide lookup#10shbernal wants to merge 1 commit into
shbernal wants to merge 1 commit into
Conversation
Adds a new tool family to the MCP server that exposes adjust-value guide names (adj, adj1, adj2, hf, vf) for every adjustable DrawingML preset shape — data sourced from ECMA-376 Annex D presetShapeDefinitions.xml, which the PDF ingestion pipeline does not index. - preset-shape-geom.ts: curated static lookup table (256 shape-guide pairs) with lookupShapeGuides() and listAdjustableShapes() exports - ooxml-tools.ts: ooxml_preset_shape tool definition, dispatch case, and three format helpers (report / no-guides / list) - mcp.ts: server description updated to four tool families; Annex D gap explicitly noted so agents know to use ooxml_preset_shape instead of ooxml_search for geometry questions - data/sources.json: ecma-376-annex-d-dml-geometries provenance entry Closes superdoc-dev#9
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
ooxml_preset_shapeMCP tool that returns the ordered adjust-value guide names (adj,adj1,adj2,hf,vf) for any DrawingML<a:prstGeom>preset shapepresetShapeDefinitions.xml(256 shape-guide pairs), following the sameopc-parts.tspattern already used for OPC package metadatahandleInitializeis updated to describe four tool families and explicitly note thatooxml_searchcannot answer Annex D geometry questions — directing agents to useooxml_preset_shapeinsteaddata/sources.jsongets aecma-376-annex-d-dml-geometriesprovenance entry explaining why this corpus is curated statically rather than ingestedMotivation
Annex D ships as a separate electronic addenda ZIP and is never ingested by the PDF pipeline. As a result, calling
ooxml_searchfor questions like "what adjust guides does round2SameRect take?" returns nothing useful. This gap caused a real bug in downstream code:round2SameRectrequiresadj1/adj2guides rather than the genericadjthatroundRectuses, and without this tool the agent had no way to discover that.Fixes #9
Files changed
apps/mcp-server/src/preset-shape-geom.tslookupShapeGuides/listAdjustableShapesexportsapps/mcp-server/src/ooxml-tools.tsapps/mcp-server/src/mcp.tsdata/sources.jsonTest plan
ooxml_preset_shapewithshape: "round2SameRect"— should returnadj1,adj2ooxml_preset_shapewithshape: "roundRect"— should returnadjooxml_preset_shapewith no args — should return full list of ~180 adjustable shapesooxml_preset_shapewithshape: "rect"— should return "no adjust values" messagebun run typecheckpasses with no new errors🤖 Generated with Claude Code