Skip to content

Conversation

@h3xxit
Copy link
Member

@h3xxit h3xxit commented Sep 9, 2025

Summary by cubic

Overhauled v1.0 docs to align with current protocol behavior, add OpenAPI compatibility, and remove WebSocket references. Clarifies parameter mapping, auth, security, and updates examples across HTTP, MCP, SSE, Streamable HTTP, Text, and Quick Start.

  • New Features

    • OpenAPI compatibility: auto-convert specs to UTCP in HTTP and Text; Quick Start shows both paths.
    • HTTP: clearer param handling order, {path_params} syntax, body_field and header_fields, API key locations (header/query/cookie), OAuth2 token caching, HTTPS-only (except localhost).
    • SSE and Streamable HTTP: unified fields (event_type, reconnect/retry_timeout, chunk_size), auth parity with HTTP, path parameters, and new usage examples.
    • MCP: new multi-server config (config.mcpServers), optional OAuth2 for HTTP servers, server-prefixed tool names, session persistence, smarter response parsing.
    • Text: simplified to local manual/OpenAPI files; no auth; relative path resolution; returns file content; API references added.
  • Migration

    • Replace ${var} in URLs with {var} (e.g., /users/{user_id}).
    • Use body_field for request bodies and header_fields for headers instead of embedding args directly.
    • Update MCP templates to use config.mcpServers; tools are prefixed by server (e.g., filesystem.read_file); consider register_resources_as_tools if needed.
    • Remove WebSocket usage; use SSE or HTTP where applicable. Security docs updated accordingly.
    • Ensure HTTPS URLs for non-local endpoints; path params are URL-encoded by the protocol.
    • Text protocol now reads local files only; remove prior URL/pattern/line_range features; rely on automatic OpenAPI-to-UTCP conversion when needed.

@h3xxit h3xxit merged commit 690e0dc into main Sep 9, 2025
1 check passed
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10 issues found across 11 files

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

```json
{
"max_size": 1048576 // 1MB limit
"manual_call_template": { /* original template */ },
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON example uses /* */ inside an object; JSON doesn’t support comments. Remove the comment to keep the example valid.

Prompt for AI agents
Address the following comment on versioned_docs/version-1.0/protocols/text.md at line 188:

<comment>JSON example uses /* */ inside an object; JSON doesn’t support comments. Remove the comment to keep the example valid.</comment>

<file context>
@@ -6,432 +6,216 @@ sidebar_position: 5
 ```json
 {
-  &quot;max_size&quot;: 1048576  // 1MB limit
+  &quot;manual_call_template&quot;: { /* original template */ },
+  &quot;manual&quot;: { &quot;tools&quot;: [] },
+  &quot;success&quot;: false,
</file context>
Suggested change
"manual_call_template": { /* original template */ },
"manual_call_template": {},
Fix with Cubic

### JSON Files

```json
// /path/to/manual.json
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON code block contains a // comment line, which is invalid JSON. Remove the comment or move it outside the JSON block.

Prompt for AI agents
Address the following comment on versioned_docs/version-1.0/protocols/text.md at line 147:

<comment>JSON code block contains a // comment line, which is invalid JSON. Remove the comment or move it outside the JSON block.</comment>

<file context>
@@ -6,432 +6,216 @@ sidebar_position: 5
+### JSON Files
 
 ```json
+// /path/to/manual.json
 {
-  &quot;transform&quot;: &quot;normalize_whitespace&quot;  // Normalize all whitespace
</file context>
Fix with Cubic

"max_size": 65536
}
"call_template_type": "text",
"file_path": "manuals/my_tools.json" // Resolved against client root_dir
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON example includes a trailing // comment, which is invalid JSON and may confuse readers. Remove the comment or move it to surrounding prose.

Prompt for AI agents
Address the following comment on versioned_docs/version-1.0/protocols/text.md at line 66:

<comment>JSON example includes a trailing // comment, which is invalid JSON and may confuse readers. Remove the comment or move it to surrounding prose.</comment>

<file context>
@@ -6,432 +6,216 @@ sidebar_position: 5
-    &quot;max_size&quot;: 65536
-  }
+  &quot;call_template_type&quot;: &quot;text&quot;,
+  &quot;file_path&quot;: &quot;manuals/my_tools.json&quot;  // Resolved against client root_dir
 }

</file context>


</details>

```suggestion
  "file_path": "manuals/my_tools.json"
Fix with Cubic

The Text call template has a simple structure for reading UTCP manuals from files. For complete field specifications and validation rules, see the [Text Call Template API Reference](../api/plugins/communication_protocols/text/src/utcp_text/text_call_template.md).

## File Sources
### Required Fields
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heading labels these as required, but auth is not required (it's always None). Rename the heading to avoid implying auth must be supplied.

Prompt for AI agents
Address the following comment on versioned_docs/version-1.0/protocols/text.md at line 31:

<comment>Heading labels these as required, but auth is not required (it&#39;s always None). Rename the heading to avoid implying auth must be supplied.</comment>

<file context>
@@ -6,432 +6,216 @@ sidebar_position: 5
+The Text call template has a simple structure for reading UTCP manuals from files. For complete field specifications and validation rules, see the [Text Call Template API Reference](../api/plugins/communication_protocols/text/src/utcp_text/text_call_template.md).
 
-## File Sources
+### Required Fields
 
-### Local Files
</file context>
Suggested change
### Required Fields
### Fields
Fix with Cubic

client = UtcpClient()

# Register streamable HTTP provider
await client.register_tool_provider(streamable_http_manual)
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usage example calls UtcpClient.register_tool_provider, which does not exist; use register_manual instead to align with the documented API.

Prompt for AI agents
Address the following comment on versioned_docs/version-1.0/protocols/streamable-http.md at line 249:

<comment>The usage example calls UtcpClient.register_tool_provider, which does not exist; use register_manual instead to align with the documented API.</comment>

<file context>
@@ -99,7 +163,105 @@ Errors are handled similarly to the standard HTTP protocol:
+    client = UtcpClient()
+    
+    # Register streamable HTTP provider
+    await client.register_tool_provider(streamable_http_manual)
+    
+    # Stream large dataset
</file context>
Suggested change
await client.register_tool_provider(streamable_http_manual)
await client.register_manual(streamable_http_manual)
Fix with Cubic

client = UtcpClient()

# Register SSE provider
await client.register_tool_provider(sse_manual)
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define the provider variable used in the example or reference an existing example provider to avoid undefined-name errors.

Prompt for AI agents
Address the following comment on versioned_docs/version-1.0/protocols/sse.md at line 412:

<comment>Define the provider variable used in the example or reference an existing example provider to avoid undefined-name errors.</comment>

<file context>
@@ -318,47 +341,86 @@ data: {&quot;message&quot;: &quot;Simple data without event type&quot;}
+    client = UtcpClient()
+    
+    # Register SSE provider
+    await client.register_tool_provider(sse_manual)
+    
+    # Stream events with automatic filtering and reconnection
</file context>
Fix with Cubic

"retry_timeout": 30000,
"auth": {
"auth_type": "api_key",
"api_key": "${STOCK_API_KEY}",
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a Bearer-prefixed value for Authorization to align with the API Key Authentication example and common practice.

Prompt for AI agents
Address the following comment on versioned_docs/version-1.0/protocols/sse.md at line 177:

<comment>Use a Bearer-prefixed value for Authorization to align with the API Key Authentication example and common practice.</comment>

<file context>
@@ -133,27 +162,21 @@ SSE uses standard HTTP authentication methods:
+    &quot;retry_timeout&quot;: 30000,
+    &quot;auth&quot;: {
+      &quot;auth_type&quot;: &quot;api_key&quot;,
+      &quot;api_key&quot;: &quot;${STOCK_API_KEY}&quot;,
+      &quot;var_name&quot;: &quot;Authorization&quot;,
+      &quot;location&quot;: &quot;header&quot;
</file context>
Suggested change
"api_key": "${STOCK_API_KEY}",
"api_key": "Bearer ${STOCK_API_KEY}",
Fix with Cubic

"manual_call_templates": [{
"name": "github_manual",
"call_template_type": "text",
"file_path": "./github_manual.json",
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the trailing comma after file_path to make the JSON valid.

Prompt for AI agents
Address the following comment on versioned_docs/version-1.0/index.md at line 122:

<comment>Remove the trailing comma after file_path to make the JSON valid.</comment>

<file context>
@@ -72,31 +81,55 @@ Add a discovery endpoint to your existing API:
+  &quot;manual_call_templates&quot;: [{
+    &quot;name&quot;: &quot;github_manual&quot;, 
+    &quot;call_template_type&quot;: &quot;text&quot;,
+    &quot;file_path&quot;: &quot;./github_manual.json&quot;,
+  }]
+}
</file context>
Suggested change
"file_path": "./github_manual.json",
"file_path": "./github_manual.json"
Fix with Cubic

Add a discovery endpoint to your existing API:
**Option A: Discovery via existing OpenAPI spec**

**Generate OpenAPI endpoint**: `GET http://api.github.com/openapi.json`
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use HTTPS for the GitHub OpenAPI endpoint to avoid mixed content and ensure correctness.

Prompt for AI agents
Address the following comment on versioned_docs/version-1.0/index.md at line 53:

<comment>Use HTTPS for the GitHub OpenAPI endpoint to avoid mixed content and ensure correctness.</comment>

<file context>
@@ -44,7 +48,12 @@ npm install @utcp/core @utcp/http
-Add a discovery endpoint to your existing API:
+**Option A: Discovery via existing OpenAPI spec**
+
+**Generate OpenAPI endpoint**: `GET http://api.github.com/openapi.json`
+
+
</file context>
Suggested change
**Generate OpenAPI endpoint**: `GET http://api.github.com/openapi.json`
**Generate OpenAPI endpoint**: `GET https://api.github.com/openapi.json`
Fix with Cubic

"name": "weather_api",
"call_template_type": "http",
"url": "http://localhost:8000/utcp",
"url": "http://localhost:8000/utcp", // Or http://api.github.com/openapi.json, the openapi spec gets converted automatically
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline comment makes the JSON invalid and not copy-pasteable; move the note to surrounding text or remove the comment.

Prompt for AI agents
Address the following comment on versioned_docs/version-1.0/index.md at line 95:

<comment>Inline comment makes the JSON invalid and not copy-pasteable; move the note to surrounding text or remove the comment.</comment>

<file context>
@@ -72,31 +81,55 @@ Add a discovery endpoint to your existing API:
     &quot;name&quot;: &quot;weather_api&quot;, 
     &quot;call_template_type&quot;: &quot;http&quot;,
-    &quot;url&quot;: &quot;http://localhost:8000/utcp&quot;,
+    &quot;url&quot;: &quot;http://localhost:8000/utcp&quot;, // Or http://api.github.com/openapi.json, the openapi spec gets converted automatically
     &quot;http_method&quot;: &quot;GET&quot;
   }]
</file context>
Suggested change
"url": "http://localhost:8000/utcp", // Or http://api.github.com/openapi.json, the openapi spec gets converted automatically
"url": "http://localhost:8000/utcp",
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants