Chapter 9
Tool Outputs & Permissions
Returns formatted search results from the web. Complete reference for tool output interfaces and permission types.
TodoWriteOutput
Returns confirmation with current task statistics.
| Property | Type | Description |
|---|---|---|
message | string | Success message |
stats | object | Current todo statistics |
Stats structure:
| Property | Type | Description |
|---|---|---|
total | number | Total number of tasks |
pending | number | Number of pending tasks |
in_progress | number | Number of in-progress tasks |
completed | number | Number of completed tasks |
ExitPlanModeOutput
Returns confirmation after exiting plan mode.
| Property | Type | Description |
|---|---|---|
message | string | Confirmation message |
approved | boolean? | Whether user approved the plan |
ListMcpResourcesOutput
Returns list of available MCP resources.
| Property | Type | Description |
|---|---|---|
resources | Resource[] | Available resources |
total | number | Total number of resources |
Resource structure:
| Property | Type | Description |
|---|---|---|
uri | string | Resource URI |
name | string | Resource name |
description | string? | Optional description |
mimeType | string? | Optional MIME type |
server | string | Server providing the resource |
ReadMcpResourceOutput
Returns the contents of the requested MCP resource.
| Property | Type | Description |
|---|---|---|
contents | Content[] | Resource contents |
server | string | Server that provided the resource |
Content structure:
| Property | Type | Description |
|---|---|---|
uri | string | Content URI |
mimeType | string? | Optional MIME type |
text | string? | Text content |
blob | string? | Binary content (base64) |
Permission Types
Types for managing tool permissions and access control.
PermissionUpdateUnion Type
Operations for updating permissions.
type PermissionUpdate =
| {
type: 'addRules';
rules: PermissionRuleValue[];
behavior: PermissionBehavior;
destination: PermissionUpdateDestination;
}
| {
type: 'replaceRules';
rules: PermissionRuleValue[];
behavior: PermissionBehavior;
destination: PermissionUpdateDestination;
}
| {
type: 'removeRules';
rules: PermissionRuleValue[];
behavior: PermissionBehavior;
destination: PermissionUpdateDestination;
}
| {
type: 'setMode';
mode: PermissionMode;
destination: PermissionUpdateDestination;
}
| {
type: 'addDirectories';
directories: string[];
destination: PermissionUpdateDestination;
}
| {
type: 'removeDirectories';
directories: string[];
destination: PermissionUpdateDestination;
}PermissionBehaviorType Alias
Defines the behavior for a permission rule.
type PermissionBehavior = 'allow' | 'deny' | 'ask';
| Value | Description |
|---|---|
'allow' | Automatically allow the action |
'deny' | Automatically deny the action |
'ask' | Prompt the user for permission |
PermissionUpdateDestinationType Alias
Specifies where permission settings are stored.
type PermissionUpdateDestination = | 'userSettings' // Global user settings | 'projectSettings' // Per-directory project settings | 'localSettings' // Gitignored local settings | 'session' // Current session only
| Value | Description |
|---|---|
'userSettings' | Global user settings that apply across all projects |
'projectSettings' | Per-directory project settings (committed to repo) |
'localSettings' | Gitignored local settings for personal preferences |
'session' | Current session only (not persisted) |
PermissionRuleValueInterface
Defines a permission rule for a specific tool.
type PermissionRuleValue = {
toolName: string;
ruleContent?: string;
}| Property | Type | Required | Description |
|---|---|---|---|
toolName | string | Yes | The name of the tool this rule applies to |
ruleContent | string | No | Optional rule content or pattern for matching |