MCPcopy Create free account
hub / github.com/ShipSecAI/studio / getObjectShape

Function getObjectShape

packages/component-sdk/src/tool-helpers.ts:156–168  ·  view source on GitHub ↗
(schema: unknown)

Source from the content-addressed store, hash-verified

154};
155
156function getObjectShape(schema: unknown): Record<string, AnySchema> | null {
157 if (!schema || typeof schema !== 'object') {
158 return null;
159 }
160
161 const objectSchema = schema as ZodObjectLike;
162 const shape = objectSchema.shape ?? objectSchema._def?.shape;
163 if (!shape) {
164 return null;
165 }
166
167 return typeof shape === 'function' ? shape() : shape;
168}
169
170/**
171 * Get the Zod raw shape for the action inputs only (inputs exposed to the agent).

Callers 3

getExposedParameterIdsFunction · 0.70
getToolInputShapeFunction · 0.70
getToolSchemaFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected