tool_call
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AllowedOutcome aclientp.schema.tool_call The user selected one of the provided options. |
||
| ContentToolCallContent aclientp.schema.tool_call Standard content block (text, images, resources). |
||
| DeniedOutcome aclientp.schema.tool_call The prompt turn was cancelled before the user responded. |
||
| FileEditToolCallContent aclientp.schema.tool_call File modification shown as a diff. |
||
| PermissionOption aclientp.schema.tool_call An option presented to the user when requesting permission. |
||
| SessionReferenceToolCallContent aclientp.schema.tool_call **UNSTABLE**: Reference to another session, e.g. a subagent spawned by this tool call. |
||
| TerminalToolCallContent aclientp.schema.tool_call Embed a terminal created with `terminal/create` by its id. |
||
| ToolCallLocation aclientp.schema.tool_call A file location being accessed or modified by a tool. |
||
| ToolCallUpdate aclientp.schema.tool_call Details about the tool call requiring permission. |
🛈 DocStrings¶
Tool call schema definitions.
RequestPermissionOutcome
module-attribute
¶
RequestPermissionOutcome = DeniedOutcome | AllowedOutcome
The user's decision on a permission request: cancelled, or an option selected.
AllowedOutcome
¶
Bases: AnnotatedObject
The user selected one of the provided options.
Source code in src/aclientp/schema/tool_call.py
ContentToolCallContent
¶
Bases: AnnotatedObject
Standard content block (text, images, resources).
Source code in src/aclientp/schema/tool_call.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | |
type
class-attribute
instance-attribute
¶
Standard content block (text, images, resources).
audio
classmethod
¶
audio(
data: str | bytes,
mime_type: str,
audience: Audience | None = None,
last_modified: datetime | str | None = None,
priority: float | None = None,
) -> Self
Create a ToolCallContent containing audio content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
str | bytes
|
The audio data. |
required |
mime_type
|
str
|
The MIME type of the audio data. |
required |
audience
|
Audience | None
|
The audience for the audio chunk. |
None
|
last_modified
|
datetime | str | None
|
The last modified date of the audio chunk. |
None
|
priority
|
float | None
|
The priority of the audio chunk. |
None
|
Source code in src/aclientp/schema/tool_call.py
embedded_blob_resource
classmethod
¶
embedded_blob_resource(
data: bytes | str,
uri: str,
mime_type: str | None = None,
audience: Audience | None = None,
last_modified: datetime | str | None = None,
priority: float | None = None,
) -> Self
Create a ToolCallContent containing an embedded blob resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
bytes | str
|
The data to embed. |
required |
uri
|
str
|
The URI of the resource. |
required |
mime_type
|
str | None
|
The MIME type of the resource. |
None
|
audience
|
Audience | None
|
The audience to apply to the resource. |
None
|
last_modified
|
datetime | str | None
|
The last modified date of the resource. |
None
|
priority
|
float | None
|
The priority of the resource. |
None
|
Source code in src/aclientp/schema/tool_call.py
embedded_text_resource
classmethod
¶
embedded_text_resource(
text: str,
uri: str,
mime_type: str | None = None,
audience: Audience | None = None,
last_modified: datetime | str | None = None,
priority: float | None = None,
) -> Self
Create a ToolCallContent containing an embedded text resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to embed. |
required |
uri
|
str
|
The URI of the resource. |
required |
mime_type
|
str | None
|
The MIME type of the resource. |
None
|
audience
|
Audience | None
|
The audience to apply to the resource. |
None
|
last_modified
|
datetime | str | None
|
The last modified date of the resource. |
None
|
priority
|
float | None
|
The priority of the resource. |
None
|
Source code in src/aclientp/schema/tool_call.py
image
classmethod
¶
image(
data: str | bytes,
mime_type: str,
uri: str | None = None,
audience: Audience | None = None,
last_modified: datetime | str | None = None,
priority: float | None = None,
) -> Self
Create a ToolCallContent containing an embedded image resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
str | bytes
|
The image data. |
required |
mime_type
|
str
|
The MIME type of the image. |
required |
uri
|
str | None
|
The URI of the image. |
None
|
audience
|
Audience | None
|
The audience for the image. |
None
|
last_modified
|
datetime | str | None
|
The last modified date of the image. |
None
|
priority
|
float | None
|
The priority of the image. |
None
|
Source code in src/aclientp/schema/tool_call.py
resource
classmethod
¶
resource(
name: str,
uri: str,
description: str | None = None,
mime_type: str | None = None,
size: int | None = None,
title: str | None = None,
audience: Audience | None = None,
last_modified: datetime | str | None = None,
priority: float | None = None,
) -> Self
Create a ToolCallContent containing a resource content block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the resource. |
required |
uri
|
str
|
The URI of the resource. |
required |
description
|
str | None
|
The description of the resource. |
None
|
mime_type
|
str | None
|
The MIME type of the resource. |
None
|
size
|
int | None
|
The size of the resource. |
None
|
title
|
str | None
|
The title of the resource. |
None
|
audience
|
Audience | None
|
The audience of the resource. |
None
|
last_modified
|
datetime | str | None
|
The last modified date of the resource. |
None
|
priority
|
float | None
|
The priority of the resource. |
None
|
Source code in src/aclientp/schema/tool_call.py
text
classmethod
¶
text(
text: str,
*,
audience: Audience | None = None,
last_modified: datetime | str | None = None,
priority: float | None = None,
) -> Self
Create a ToolCallContent containing text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text content. |
required |
audience
|
Audience | None
|
The audience for the text. |
None
|
last_modified
|
datetime | str | None
|
The last modified date of the text. |
None
|
priority
|
float | None
|
The priority of the text. |
None
|
Source code in src/aclientp/schema/tool_call.py
DeniedOutcome
¶
Bases: Schema
The prompt turn was cancelled before the user responded.
When a client sends a session/cancel notification to cancel an ongoing
prompt turn, it MUST respond to all pending session/request_permission
requests with this Cancelled outcome.
See protocol docs: Cancellation
Source code in src/aclientp/schema/tool_call.py
FileEditToolCallContent
¶
Bases: AnnotatedObject
File modification shown as a diff.
Source code in src/aclientp/schema/tool_call.py
PermissionOption
¶
Bases: AnnotatedObject
An option presented to the user when requesting permission.
Source code in src/aclientp/schema/tool_call.py
SessionReferenceToolCallContent
¶
Bases: AnnotatedObject
UNSTABLE: Reference to another session, e.g. a subagent spawned by this tool call.
Source code in src/aclientp/schema/tool_call.py
TerminalToolCallContent
¶
Bases: AnnotatedObject
Embed a terminal created with terminal/create by its id.
The terminal must be added before calling terminal/release.
See protocol docs: Terminal
Source code in src/aclientp/schema/tool_call.py
ToolCallLocation
¶
Bases: AnnotatedObject
A file location being accessed or modified by a tool.
Enables clients to implement "follow-along" features that track which files the agent is working with in real-time. See protocol docs: Following the Agent
Source code in src/aclientp/schema/tool_call.py
line
class-attribute
instance-attribute
¶
Optional 1-based line number within the file.
Defaults to 0 (unspecified) rather than None: some clients only render clickable paths when the field is present.
ToolCallUpdate
¶
Bases: AnnotatedObject
Details about the tool call requiring permission.
Source code in src/aclientp/schema/tool_call.py
content
class-attribute
instance-attribute
¶
Replace the content collection.
locations
class-attribute
instance-attribute
¶
locations: Sequence[ToolCallLocation] | None = None
Replace the locations collection.
name
class-attribute
instance-attribute
¶
Programmatic name of the tool being invoked.
raw_output
class-attribute
instance-attribute
¶
Update the raw output.
status
class-attribute
instance-attribute
¶
Update the execution status.
title
class-attribute
instance-attribute
¶
Update the human-readable title.