Query
AI-generatedSummary
Query the Claude Agent SDK with a specified prompt and configuration options to obtain AI-generated coding assistance.
Inputs
- prompt (required) — The prompt or instruction to send to Claude Agent SDK.
- model — Claude model to use, defaulting to 'sonnet'.
- maxTurns — Maximum number of conversation turns allowed, with a default of 25.
- timeout — Maximum wait time for completion in seconds, defaulting to 300.
- projectPath — Directory path for Claude Agent SDK; defaults to the current working directory.
- outputFormat — Choose how to format the output data, defaulting to 'structured'.
- allowedTools — Select tools permitted for use by the Claude Agent SDK.
- disallowedTools — Select tools explicitly blocked from use.
- additionalOptions — Includes options like debug mode and permission settings.
Output shape
a structured object including messages, summary, result, and metrics
Results depend on selected output format, which can be 'structured', 'messages', or 'text'. Potential errors include abort due to timeout or execution failure.
Examples
Example 1: Asking the Claude Agent SDK to create a Python function for parsing CSV files.
Set the prompt to 'Create a Python function to parse CSV files', choose 'sonnet' model, set maxTurns to 30, and outputFormat to 'text'.
Example 2: Requesting code documentation from the Assistant.
Use 'Document this code' as the prompt, allow tools such as 'Edit' and 'WebFetch', and ensure timeout is set to 600 seconds.