Cursor python sdk use

When running locally with the Python SDK, the Agent does not call the AskQuestion tool (it does call it in Cursor IDE, but not in the SDK). The confirmation items are written into the “Pending your confirmation” paragraph of the createPlan. The bot only recognizes createPlan → directly pops up the plan confirmation card, skipping the multiple-choice questions.

How can I handle the fact that I cannot capture the use of this tool, so that I can display the question selection in my application?

AskQuestion isn’t currently exposed through the SDK. In local SDK runs, the agent’s clarifying-question requests are both filtered out of the event stream and automatically declined, so there’s no SDK event you can hook into to capture them - this is by design today, not something specific to your setup. It’s only surfaced in clients that implement the interactive UI (the IDE, and the CLI on recent versions).

That’s also why you’re seeing them inside createPlan: in Plan mode, when the interactive prompt can’t be surfaced, the clarifications get folded into the “Pending your confirmation” section of the plan, so the only event your app receives is createPlan.

Practical options right now:

  • Parse the questions out of the createPlan content if you need to render them. That’s currently the only programmatic handle on them.
  • If you don’t want confirmations embedded in the plan at all, run outside Plan mode — the agent will proceed without the plan-embedded prompts (though it still won’t emit separate AskQuestion events).

First-class AskQuestion support in the SDK isn’t available yet, but surfacing the full interaction stream through the SDK is something we’re tracking. I’ll add your use case to that.