Skip to content

Commit 1b40ce7

Browse files
committed
Docs version 1.1
1 parent c69773c commit 1b40ce7

File tree

77 files changed

+10420
-30
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+10420
-30
lines changed

docs/api/core/utcp/data/call_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,19 @@ inherit from. It provides the common fields that every provider must have.
2424
Should be unique across all providers and recommended to be set to a human-readable name.
2525
Can only contain letters, numbers and underscores. All special characters must be replaced with underscores.
2626
- **`call_template_type`**: The transport protocol type used by this provider.
27+
- **`allowed_communication_protocols`**: Optional list of communication protocol types that tools
28+
registered under this manual are allowed to use. If None or empty, defaults to only allowing
29+
the same protocol type as the manual's call_template_type. This provides fine-grained security
30+
control - e.g., set to ["http", "cli"] to allow both HTTP and CLI tools, or leave unset to
31+
restrict tools to the manual's own protocol type.
2732
</details>
2833

2934
#### Fields:
3035

3136
- name: str
3237
- call_template_type: str
3338
- auth: Optional[[Auth](./auth.md#auth)]
39+
- allowed_communication_protocols: Optional[List[str]]
3440

3541
---
3642

docs/api/core/utcp/implementations/default_variable_substitutor.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ Non-string types are returned unchanged. String values are scanned
5252
for variable references using $\{VAR\} and $VAR syntax.
5353

5454

55+
**Note**
56+
57+
Strings containing '$ref' are skipped to support OpenAPI specs
58+
stored as string content, where $ref is a JSON reference keyword.
59+
60+
61+
5562
**Args**
5663

5764
- **`obj`**: Object to perform substitution on. Can be any type.
@@ -97,6 +104,13 @@ returning fully-qualified variable names with variable namespacing.
97104
Useful for validation and dependency analysis.
98105

99106

107+
**Note**
108+
109+
Strings containing '$ref' are skipped to support OpenAPI specs
110+
stored as string content, where $ref is a JSON reference keyword.
111+
112+
113+
100114
**Args**
101115

102116
- **`obj`**: Object to scan for variable references.
@@ -113,7 +127,7 @@ Useful for validation and dependency analysis.
113127

114128
**Returns**
115129

116-
List of fully-qualified variable names found in the object.
130+
List of unique fully-qualified variable names found in the object.
117131

118132

119133

docs/api/core/utcp/implementations/utcp_client_implementation.md

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ A new `[UtcpClient](./../utcp_client.md#utcpclient)` instance.
3636

3737
Register a manual in the client.
3838

39+
Registers a manual and its tools with the client. During registration, tools are
40+
41+
**Filtered Based On The Manual'S `Allowed_Communication_Protocols` Setting**
42+
43+
44+
- If `allowed_communication_protocols` is set to a non-empty list, only tools using
45+
protocols in that list are registered.
46+
- If `allowed_communication_protocols` is None or empty, it defaults to only allowing
47+
the manual's own `call_template_type`. This provides secure-by-default behavior.
48+
49+
Tools that don't match the allowed protocols are excluded from registration and a
50+
warning is logged for each excluded tool.
51+
52+
3953

4054
**Args**
4155

@@ -45,7 +59,14 @@ Register a manual in the client.
4559

4660
**Returns**
4761

48-
A `[RegisterManualResult](./../data/register_manual_response.md#registermanualresult)` instance representing the result of the registration.
62+
A `[RegisterManualResult](./../data/register_manual_response.md#registermanualresult)` instance containing the registered tools (filtered by
63+
allowed protocols) and any errors encountered.
64+
65+
66+
67+
**Raises**
68+
69+
- **`ValueError`**: If manual name is already registered or communication protocol is not found.
4970
</details>
5071

5172
<details>
@@ -87,35 +108,73 @@ A boolean indicating whether the manual was successfully deregistered.
87108

88109
Call a tool in the client.
89110

111+
Executes a registered tool with the provided arguments. Before execution, validates
112+
that the tool's communication protocol is allowed by the parent manual's
113+
114+
**`Allowed_Communication_Protocols` Setting**
115+
116+
117+
- If `allowed_communication_protocols` is set to a non-empty list, the tool's protocol
118+
must be in that list.
119+
- If `allowed_communication_protocols` is None or empty, only tools using the manual's
120+
own `call_template_type` are allowed.
121+
122+
90123

91124
**Args**
92125

93-
- **`tool_name`**: The name of the tool to call.
126+
- **`tool_name`**: The fully qualified name of the tool (e.g., "manual_name.tool_name").
94127
- **`tool_args`**: A dictionary of arguments to pass to the tool.
95128

96129

97130

98131
**Returns**
99132

100-
The result of the tool call.
133+
The result of the tool call, after any post-processing.
134+
135+
136+
137+
**Raises**
138+
139+
- **`ValueError`**: If the tool is not found or if the tool's communication protocol
140+
is not in the manual's allowed protocols.
101141
</details>
102142

103143
<details>
104144
<summary>async call_tool_streaming(self, tool_name: str, tool_args: Dict[str, Any]) -> AsyncGenerator[Any, None]</summary>
105145

106-
Call a tool in the client streamingly.
146+
Call a tool in the client with streaming response.
147+
148+
Executes a registered tool with streaming output. Before execution, validates
149+
that the tool's communication protocol is allowed by the parent manual's
150+
151+
**`Allowed_Communication_Protocols` Setting**
152+
153+
154+
- If `allowed_communication_protocols` is set to a non-empty list, the tool's protocol
155+
must be in that list.
156+
- If `allowed_communication_protocols` is None or empty, only tools using the manual's
157+
own `call_template_type` are allowed.
158+
107159

108160

109161
**Args**
110162

111-
- **`tool_name`**: The name of the tool to call.
163+
- **`tool_name`**: The fully qualified name of the tool (e.g., "manual_name.tool_name").
112164
- **`tool_args`**: A dictionary of arguments to pass to the tool.
113165

114166

115167

116-
**Returns**
168+
**Yields**
169+
170+
Chunks of the tool's streaming response, after any post-processing.
171+
172+
173+
174+
**Raises**
117175

118-
An async generator yielding the result of the tool call.
176+
- **`ValueError`**: If the tool is not found or if the tool's communication protocol
177+
is not in the manual's allowed protocols.
119178
</details>
120179

121180
<details>

docs/api/index.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ This specification is organized by module of the reference python implementation
1111

1212
**Note:** The modules don't have to be implemented in the same way as in the reference implementation, but all of the functionality here needs to be provided.
1313

14-
**Total documented items:** 195
15-
**Modules documented:** 41
14+
**Total documented items:** 211
15+
**Modules documented:** 45
1616

1717
## Core Modules
1818

@@ -172,6 +172,16 @@ Plugin implementations that extend UTCP with specific transport protocols and ca
172172
- **Contains:** 1 classes, 4 methods
173173

174174

175+
### [communication_protocols.file.src.utcp_file.file_call_template](./plugins\communication_protocols\file\src\utcp_file\file_call_template.md)
176+
177+
- **Contains:** 2 classes, 2 methods
178+
179+
180+
### [communication_protocols.file.src.utcp_file.file_communication_protocol](./plugins\communication_protocols\file\src\utcp_file\file_communication_protocol.md)
181+
182+
- **Contains:** 1 classes, 4 methods
183+
184+
175185
### [communication_protocols.http.src.utcp_http.http_call_template](./plugins\communication_protocols\http\src\utcp_http\http_call_template.md)
176186

177187
- **Contains:** 2 classes, 2 methods
@@ -227,6 +237,16 @@ Plugin implementations that extend UTCP with specific transport protocols and ca
227237
- **Contains:** 1 classes, 4 methods
228238

229239

240+
### [communication_protocols.websocket.src.utcp_websocket.websocket_call_template](./plugins\communication_protocols\websocket\src\utcp_websocket\websocket_call_template.md)
241+
242+
- **Contains:** 2 classes
243+
244+
245+
### [communication_protocols.websocket.src.utcp_websocket.websocket_communication_protocol](./plugins\communication_protocols\websocket\src\utcp_websocket\websocket_communication_protocol.md)
246+
247+
- **Contains:** 1 classes, 4 methods
248+
249+
230250
## About UTCP
231251

232252
The Universal Tool Calling Protocol (UTCP) is a framework for calling tools across various transport protocols.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: file_call_template
3+
sidebar_label: file_call_template
4+
---
5+
6+
# file_call_template
7+
8+
**File:** `plugins/communication_protocols/file/src/utcp_file/file_call_template.py`
9+
10+
### class FileCallTemplate ([CallTemplate](./../../../../../core/utcp/data/call_template.md#calltemplate)) {#filecalltemplate}
11+
12+
<details>
13+
<summary>Documentation</summary>
14+
15+
Call template for file-based manuals and tools.
16+
17+
Reads UTCP manuals or tool definitions from local JSON/YAML files. Useful for
18+
static tool configurations or environments where manuals are distributed as files.
19+
For direct text content, use the text protocol instead.
20+
21+
22+
**Attributes**
23+
24+
- **`call_template_type`**: Always "file" for file call templates.
25+
- **`file_path`**: Path to the file containing the UTCP manual or tool definitions.
26+
- **`auth`**: Always None - file call templates don't support authentication for file access.
27+
- **`auth_tools`**: Optional authentication to apply to generated tools from OpenAPI specs.
28+
</details>
29+
30+
#### Fields:
31+
32+
- call_template_type: Literal['file']
33+
- file_path: str
34+
- auth: None
35+
- auth_tools: Optional[[Auth](./../../../../../core/utcp/data/auth.md#auth)]
36+
37+
---
38+
39+
### class FileCallTemplateSerializer ([Serializer](./../../../../../core/utcp/interfaces/serializer.md#serializer)[FileCallTemplate]) {#filecalltemplateserializer}
40+
41+
*No class documentation available*
42+
43+
#### Methods:
44+
45+
<details>
46+
<summary>to_dict(self, obj: FileCallTemplate) -> dict</summary>
47+
48+
*No method documentation available*
49+
</details>
50+
51+
<details>
52+
<summary>validate_dict(self, obj: dict) -> FileCallTemplate</summary>
53+
54+
*No method documentation available*
55+
</details>
56+
57+
---
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: file_communication_protocol
3+
sidebar_label: file_communication_protocol
4+
---
5+
6+
# file_communication_protocol
7+
8+
**File:** `plugins/communication_protocols/file/src/utcp_file/file_communication_protocol.py`
9+
10+
### class FileCommunicationProtocol ([CommunicationProtocol](./../../../../../core/utcp/interfaces/communication_protocol.md#communicationprotocol)) {#filecommunicationprotocol}
11+
12+
*No class documentation available*
13+
14+
#### Methods:
15+
16+
<details>
17+
<summary>async register_manual(self, caller: '[UtcpClient](./../../../../../core/utcp/utcp_client.md#utcpclient)', manual_call_template: [CallTemplate](./../../../../../core/utcp/data/call_template.md#calltemplate)) -> [RegisterManualResult](./../../../../../core/utcp/data/register_manual_response.md#registermanualresult)</summary>
18+
19+
*No method documentation available*
20+
</details>
21+
22+
<details>
23+
<summary>async deregister_manual(self, caller: '[UtcpClient](./../../../../../core/utcp/utcp_client.md#utcpclient)', manual_call_template: [CallTemplate](./../../../../../core/utcp/data/call_template.md#calltemplate)) -> None</summary>
24+
25+
*No method documentation available*
26+
</details>
27+
28+
<details>
29+
<summary>async call_tool(self, caller: '[UtcpClient](./../../../../../core/utcp/utcp_client.md#utcpclient)', tool_name: str, tool_args: Dict[str, Any], tool_call_template: [CallTemplate](./../../../../../core/utcp/data/call_template.md#calltemplate)) -> Any</summary>
30+
31+
*No method documentation available*
32+
</details>
33+
34+
<details>
35+
<summary>async call_tool_streaming(self, caller: '[UtcpClient](./../../../../../core/utcp/utcp_client.md#utcpclient)', tool_name: str, tool_args: Dict[str, Any], tool_call_template: [CallTemplate](./../../../../../core/utcp/data/call_template.md#calltemplate)) -> AsyncGenerator[Any, None]</summary>
36+
37+
*No method documentation available*
38+
</details>
39+
40+
---

docs/api/plugins/communication_protocols/http/src/utcp_http/http_call_template.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ URL body, headers or query pattern parameters are passed as query parameters usi
4848
"var_name": "Authorization",
4949
"location": "header"
5050
},
51+
"auth_tools": {
52+
"auth_type": "api_key",
53+
"api_key": "Bearer ${TOOL_API_KEY}",
54+
"var_name": "Authorization",
55+
"location": "header"
56+
},
5157
"headers": {
5258
"X-Custom-Header": "value"
5359
},
@@ -102,7 +108,8 @@ URL body, headers or query pattern parameters are passed as query parameters usi
102108
- **`url`**: The base URL for the HTTP endpoint. Supports path parameters like
103109
"https://api.example.com/users/{user_id}/posts/{post_id}".
104110
- **`content_type`**: The Content-Type header for requests.
105-
- **`auth`**: Optional authentication configuration.
111+
- **`auth`**: Optional authentication configuration for accessing the OpenAPI spec URL.
112+
- **`auth_tools`**: Optional authentication configuration for generated tools. Applied only to endpoints requiring auth per OpenAPI spec.
106113
- **`headers`**: Optional static headers to include in all requests.
107114
- **`body_field`**: Name of the tool argument to map to the HTTP request body.
108115
- **`header_fields`**: List of tool argument names to map to HTTP request headers.
@@ -115,6 +122,7 @@ URL body, headers or query pattern parameters are passed as query parameters usi
115122
- url: str
116123
- content_type: str
117124
- auth: Optional[[Auth](./../../../../../core/utcp/data/auth.md#auth)]
125+
- auth_tools: Optional[[Auth](./../../../../../core/utcp/data/auth.md#auth)]
118126
- headers: Optional[Dict[str, str]]
119127
- body_field: Optional[str]
120128
- header_fields: Optional[List[str]]

docs/api/plugins/communication_protocols/text/src/utcp_text/text_call_template.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,30 @@ sidebar_label: text_call_template
1212
<details>
1313
<summary>Documentation</summary>
1414

15-
Call template for text file-based manuals and tools.
15+
Text call template for UTCP client.
1616

17-
Reads UTCP manuals or tool definitions from local JSON/YAML files. Useful for
18-
static tool configurations or environments where manuals are distributed as files.
17+
This template allows passing UTCP manuals or tool definitions directly as text content.
18+
It supports both JSON and YAML formats and can convert OpenAPI specifications to UTCP manuals.
19+
It's browser-compatible and requires no file system access.
20+
For file-based manuals, use the file protocol instead.
1921

2022

2123
**Attributes**
2224

23-
- **`call_template_type`**: Always "text" for text file call templates.
24-
- **`file_path`**: Path to the file containing the UTCP manual or tool definitions.
25+
- **`call_template_type`**: Always "text" for text call templates.
26+
- **`content`**: Direct text content of the UTCP manual or tool definitions (required).
27+
- **`base_url`**: Optional base URL for API endpoints when converting OpenAPI specs.
2528
- **`auth`**: Always None - text call templates don't support authentication.
29+
- **`auth_tools`**: Optional authentication to apply to generated tools from OpenAPI specs.
2630
</details>
2731

2832
#### Fields:
2933

3034
- call_template_type: Literal['text']
31-
- file_path: str
35+
- content: str
36+
- base_url: Optional[str]
3237
- auth: None
38+
- auth_tools: Optional[[Auth](./../../../../../core/utcp/data/auth.md#auth)]
3339

3440
---
3541

0 commit comments

Comments
 (0)