feat(api): publish agent tool input schema - #7109
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThe PR publishes named OpenAPI components for Agent integration, custom, and MCP tool inputs and applies that validation to workflow add, edit, and subflow-insert operations.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking need to add the repository-required bounds to the newly exposed Agent tool boundary schemas. The tool variants and operation wiring are consistent with current stored shapes, but the new tools array and several identifier/name fields publish no upper bounds. Files Needing Attention: apps/sim/lib/api/contracts/v2/workflows.ts
|
| Filename | Overview |
|---|---|
| apps/sim/lib/api/contracts/v2/workflows.ts | Adds the Agent tool schemas and operation-input wiring; the new boundary fields omit repository-required collection and string maximum bounds. |
| apps/sim/lib/api/contracts/v2/tests/workflow-agent-tools.test.ts | Covers accepted integration, custom, legacy-inline, and MCP shapes plus malformed reserved tool rejection. |
| apps/sim/lib/api/contracts/v2/openapi/workflows.ts | Documents Agent inputs.tools as the typed exception within otherwise open catalog-defined block inputs. |
| packages/sim-cli/src/generated/v2-api.ts | Projects the new Agent tool union into generated TypeScript operation-body types. |
| apps/docs/openapi-v2-workflows.json | Regenerates the workflows OpenAPI document with named Agent tool components and operation references. |
| scripts/openapi/documents.test.ts | Verifies named tool variants and their inclusion in WorkflowEditOperation. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Request[Workflow operation request] --> Operation{Operation type}
Operation -->|add/edit/insert| Inputs[Open block inputs]
Inputs --> Tools[Typed inputs.tools]
Tools --> Integration[Integration tool]
Tools --> Custom[Custom tool]
Tools --> MCP[MCP tool]
Tools --> OpenAPI[Named OpenAPI components]
OpenAPI --> CLI[Generated CLI types]
Reviews (1): Last reviewed commit: "feat(api): publish agent tool input sche..." | Re-trigger Greptile
| export const v2AgentToolInputSchema = z | ||
| .array(v2AgentToolSchema) |
There was a problem hiding this comment.
The new tools array and the inline function name, MCP server ID, and MCP tool name omit the repository-required upper bounds, publishing weaker API limits and allowing unnecessarily large workflow-operation payloads.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
inputs.toolsshapes for workflow operations while preserving open block inputsType of Change
Testing
bun run lintbun run check:auditsChecklist