You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add outputSchema option to fetch-actor-details tools (#413)
* feat: add outputSchema option to fetch-actor-details tools
- Add outputSchema boolean option to actorDetailsOutputOptionsSchema
- Pass actorOutputSchema through meta from internal server
- Add typeObjectToString utility for human-readable type display
- Include outputSchema in structured response content
- Update fetch-actor-details and fetch-actor-details-internal tools
* feat: add previewOutput option to call-actor tool and fix outputSchema type
## Summary
- Add optional `previewOutput` parameter (default: true) to call-actor tool for controlling dataset preview in responses
- Fix `outputSchema` field type in actorDetailsOutputSchema from string to object
- Reduce context clutter when users plan to fetch specific fields via get-actor-output tool
## Technical Changes
- Add `previewOutput` boolean parameter to callActorArgs Zod schema with contextual description
- Pass `previewOutput` through callActorGetDataset to conditionally skip preview items extraction
- Update buildActorResponseContent to handle both preview modes with appropriate messaging
- Change actorDetailsOutputSchema.outputSchema type from 'string' to 'object' to match actual data
- Add 2 integration tests for previewOutput feature (true and false modes)
## Backward Compatibility
- previewOutput defaults to true, maintaining existing behavior
- No breaking changes to public API
@@ -345,6 +348,9 @@ For MCP server Actors, use format "actorName:toolName" to call a specific tool (
345
348
async: z.boolean()
346
349
.optional()
347
350
.describe(`When true: starts the run and returns immediately with runId. When false or not provided: waits for completion and returns results immediately. Default: true when UI mode is enabled (enforced), false otherwise. Note: When UI mode is enabled, async is always true regardless of this parameter and the widget automatically tracks progress.`),
351
+
previewOutput: z.boolean()
352
+
.optional()
353
+
.describe('When true (default): includes preview items. When false: metadata only (reduces context). Use when fetching fields via get-actor-output.'),
texts.push(`# Output Schema\nNo output schema available. The Actor may not have recent successful runs, or the output structure could not be determined.`);
@@ -46,9 +48,16 @@ Above this text block is a preview of the Actor output containing ${result.previ
46
48
If you need to retrieve additional data, use the "get-actor-output" tool with: datasetId: "${datasetId}". Be sure to limit the number of results when using the "get-actor-output" tool, since you never know how large the items may be, and they might exceed the output limits.
47
49
`;
48
50
51
+
constgetEmptyPreviewMessage=()=>{
52
+
if(previewOutput){
53
+
return`No items available for preview—either the Actor did not return any items or they are too large for preview. Use the "get-actor-output" tool with datasetId: "${result.datasetId}" to retrieve results.`;
54
+
}
55
+
return`Preview skipped (previewOutput: false). Use the "get-actor-output" tool with datasetId: "${result.datasetId}" to retrieve results or specific fields.`;
: `No items available for preview—either the Actor did not return any items or they are too large for preview. In this case, use the "get-actor-output" tool.`;
0 commit comments