AI / Universal Tool Calling Protocol (UTCP) Interview questions
Last updated
1. What is UTCP?
UTCP (Universal Tool Calling Protocol) is an open standard that lets AI agents discover tools and call them directly, using each tool's own native protocol. There is no wrapper or proxy server sitting in the middle.
A tool provider publishes a manual: a JSON document that lists its tools and spells out how to call each one (URL, method, auth, and so on). The agent reads the manual and then talks to the API itself.
The project's guiding idea is simple: if a human can call your API, an agent should be able to as well, with the same security and no extra infrastructure.
Take quiz
By sending a test request to a wrapper server first
By training the model on the tool's source code
By reading a manual that describes the tool and its call details
Agents call existing APIs directly with no middleman
Every tool must be rewritten as a JSON-RPC server
All traffic must pass through a central gateway
2. What problem does UTCP solve?
Most tool-integration approaches make you stand up a wrapper server for every tool and route all traffic through it. UTCP removes that layer by describing how to call the existing API directly.
According to the UTCP documentation, the wrapper-based approach forces teams to:
- build and maintain a wrapper server per tool
- send every call through a middleman protocol
- re-implement authentication and security that the API already has
- accept extra latency and operational complexity
With UTCP the API keeps its own auth, scaling and monitoring. You add one discovery endpoint (or reuse an OpenAPI spec) and agents can start calling.
Take quiz
The mandatory wrapper or proxy server between agent and tool
The need for any authentication
The need for tool descriptions
Writing JSON Schema for tool inputs
Re-implementing the API's existing authentication in a wrapper
Choosing a programming language
3. What is a UTCP manual?
A UTCP manual is a JSON document that tells an agent which tools a provider offers and exactly how to call each one. Think of it as the instruction sheet that ships with the API.
A v1.x manual typically carries manual_version, utcp_version, an optional info block, and a tools array. Each tool holds its name, description, input schema and a tool_call_template.
{ "manual_version": "1.0.0", "utcp_version": "1.0.1", "tools": [{ "name": "get_weather", "description": "Get current weather for a location", "inputs": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}, "tool_call_template": {"call_template_type": "http", "url": "http://localhost:8000/weather", "http_method": "GET"} }] }
A manual can be served from an endpoint, shipped as a file, or generated by converting an OpenAPI spec. However it arrives, the client treats it the same way: parse it, register the tools and keep each tool's call template for later.
Take quiz
manual_version
tool_call_template
info
A compiled binary that proxies tool calls
A database of previous tool responses
A JSON description of tools plus direct call instructions
4. What are the core components of UTCP?
UTCP v1.x is built from four main pieces, plus a plugin layer for protocols.
| Component | Role |
| Manual | Provider-published description of available tools |
| Tool | One callable capability, with inputs, outputs and metadata |
| Call Template | Protocol-specific recipe that maps a tool call to a real request |
| UTCP Client | Engine that discovers, searches and executes tools |
The plugin system lets you add protocols, tool repositories and search strategies without touching the core package.
A useful mental split: the manual and its tools are what the provider publishes, while the call template and client are what the consumer uses to act on them.
Take quiz
Manual
Tool Repository
Call Template
UTCP Client
Manual
Call Template
5. What is a call template in UTCP?
A call template is the part of a tool definition that says how to reach the tool. Concretely, it maps a tool name plus the arguments you pass into a real request in some communication protocol.
Its call_template_type picks the protocol plugin (http, cli, sse, text, mcp), and the remaining fields are specific to that protocol. An HTTP template carries a URL and method; a CLI template carries commands.
{ "call_template_type": "http", "url": "https://api.example.com/users/{user_id}", "http_method": "GET" }
Tools in the same manual can use different templates, so one manual can mix an HTTP endpoint, a CLI command and a streaming source.
Take quiz
Which protocol plugin handles the call
Which LLM writes the arguments
Which manual version is used
An environment variable loaded from .env
A placeholder filled from the tool argument of the same name
A fixed value defined by the protocol
6. What is the UTCP client?
The UTCP client is the discovery-and-execution engine on the consumer side. You give it a configuration listing manual sources, and it fetches those manuals, registers their tools and makes them searchable and callable.
Day-to-day you use two operations: search_tools to find relevant tools for a task, and call_tool to run one. Under the hood the client picks the right protocol plugin from each tool's call template.
In the reference design its storage, search and protocol handling are pluggable interfaces, so you can swap them without rewriting your agent.
Take quiz
register_gateway
search_tools
compile_manual
It asks the model to guess the protocol
It routes everything through HTTP only
It reads the tool's call template and uses the matching protocol plugin
7. Which protocols does UTCP support?
UTCP supports protocols through plugins. The stable set documented for v1.1 is below.
| Protocol | Plugin | Typical use |
| HTTP | utcp-http |
REST APIs, webhooks |
| SSE / Streamable HTTP | utcp-http |
Streaming and live data |
| CLI | utcp-cli |
Local command-line tools |
| Text | utcp-text |
Reading files and static content |
| MCP | utcp-mcp |
Interoperating with MCP servers |
Older docs and comparison pages also mention WebSocket, GraphQL and gRPC. Check your SDK's plugin list before relying on those, since they are not in the stable table.
One manual can mix protocols as well. A single tool might use HTTP and another a CLI command, and the client picks the right plugin per tool.
Take quiz
utcp-text
utcp-cli
utcp-mcp
utcp-cli
utcp-http
utcp-mcp
8. How do you install UTCP in Python and Node.js?
Install the core package plus the protocol plugins you need. Plugins are separate packages, so a project only pulls in what it uses.
# Python pip install utcp utcp-http utcp-cli # Node.js npm install @utcp/core @utcp/http @utcp/cli
Package names have shifted between SDK releases (some TypeScript READMEs show @utcp/sdk), so confirm against the repository for your version.
After installing, build a client from a config that lists your manual sources, then use search_tools and call_tool. Add utcp-text or utcp-mcp only if you need file-based manuals or MCP interop, and pin versions in production since the project is still evolving.
Take quiz
So a project installs only the protocols it needs
Because the core cannot parse JSON
Because plugins are required for licensing
npm install utcp-http
pip install utcp utcp-http
pip install utcp-core-http-only
9. What is the /utcp discovery endpoint?
GET /utcp is the conventional endpoint where a provider returns its UTCP manual. It is how you make an existing API discoverable: add one route that returns the JSON manual and you are done.
The client then points an HTTP call template at that URL as a manual source. It is a convention rather than a fixed rule, so the path can differ, and the manual can also come from a text file or a converted OpenAPI spec.
from fastapi import FastAPI app = FastAPI() @app.get("/utcp") def utcp_discovery(): return {"manual_version": "1.0.0", "utcp_version": "1.0.1", "tools": [...]}
Many providers simply return a static JSON document from that route, which is why the docs describe the extra infrastructure as one endpoint.
Take quiz
A session token for the MCP server
The provider's UTCP manual as JSON
The result of the last tool call
Yes, clients refuse any other path
Yes, but only for CLI tools
No, it is a convention; manuals can also come from files or converted OpenAPI
10. What does a UTCP tool definition contain?
Each entry in the manual's tools array describes one capability. The essentials are a name, a description the agent can reason over, an inputs JSON Schema, and a tool_call_template.
Optional but useful fields include outputs (return schema), tags for categorising tools, and average_response_size so a client can plan resources before calling.
A clear description matters more than people expect. It is what the agent reads when deciding whether this tool fits the task.
Treat the description as part of your prompt design. Say what the tool does, when to use it and what it returns, in a sentence or two.
Take quiz
tool_call_template
manual_version
average_response_size
JSON Schema
Protocol Buffers only
Free-form text
11. How does authentication work in UTCP?
UTCP does not invent a new auth layer. A call template (or the manual) carries an auth block describing the credentials the API already expects.
The documented types are api_key (with api_key, var_name and location such as header or query) and oauth2 (client id, secret, token URL, optional scope).
"auth": { "auth_type": "api_key", "api_key": "${WEATHER_API_KEY}", "var_name": "appid", "location": "query" }
Secrets are written as ${VAR} placeholders and supplied by the client at runtime, so the manual itself never has to contain a real key.
Auth can sit at the manual level so every tool reuses the same credentials, while a sensitive tool can carry its own auth block for tighter control.
Take quiz
As a query parameter named appid
In a request header called WEATHER_API_KEY
Inside the JSON body
The manual encrypts it automatically
The client substitutes the real secret at runtime
UTCP rejects literal strings
12. What is variable substitution in UTCP?
UTCP call templates use two placeholder styles, and they mean different things.
| Syntax | Source | Example |
{name} |
A tool argument (URL path parameters) | /users/{user_id} |
${NAME} |
Client config or environment variable | ${API_KEY} |
Single braces are filled from what the agent passes when calling the tool. Dollar-brace values come from the client's variables or a loaded .env file, which keeps secrets out of manuals.
Single braces are only for values the agent supplies per call, so never put secrets there. Test each tool once after renaming variables or changing config, because a half-resolved placeholder is easy to miss.
Take quiz
{api_key}
${API_KEY}
$API_KEY$
The client's .env file
The manual_version field
The argument the agent supplies for that tool call
13. How does UTCP relate to OpenAPI?
UTCP is designed to extend OpenAPI for agents rather than replace it. OpenAPI describes an API for human developers; UTCP adds agent-oriented details such as tags, average_response_size, multi-protocol call templates and direct execution instructions.
You do not have to rewrite anything to get started. Point the client at an OpenAPI document and it converts the endpoints into UTCP tools, or run the OpenApiConverter yourself and save the manual to a file.
That makes OpenAPI-described services the cheapest on-ramp to UTCP.
Take quiz
Reject it as incompatible
Only read it as plain documentation
Convert it into UTCP tools automatically
average_response_size
operationId
servers
14. What is the CLI call template used for?
The CLI call template wraps local command-line tools so an agent can run them as UTCP tools. It holds an ordered list of commands, and each command can decide whether its output counts toward the final result.
Tool arguments are injected with UTCP_ARG_name_UTCP_END placeholders. You can also set working_dir and env_vars.
{ "call_template_type": "cli", "commands": [ {"command": "cd /app", "append_to_final_output": false}, {"command": "python script.py UTCP_ARG_input_UTCP_END", "append_to_final_output": true} ], "working_dir": "/app" }
The docs flag CLI as a high-risk protocol, so sandbox it and sanitise inputs.
Prefer one narrowly scoped command per tool, such as 'list backups', over a generic shell tool, and keep arguments to the few values the schema allows.
Take quiz
Whether that command's output is included in the final result
Whether the command runs as root
Whether the command is retried
With ${input}
With the UTCP_ARG_input_UTCP_END placeholder
With {{input}}
15. What is the text call template used for?
The text call template, from the utcp-text plugin, reads content from a file. It has two jobs: loading a manual that is saved on disk, and exposing static file content as a tool.
A typical use is converting a big OpenAPI spec once, saving the resulting manual as JSON, and then loading it like this:
{ "manual_call_templates": [{ "name": "github_manual", "call_template_type": "text", "file_path": "./github_manual.json" }] }
Because it touches the filesystem, restrict paths to approved directories and block traversal.
It is also handy for tests: a text template pointing at a local manual lets you try an agent against fixed tools with no network involved.
Take quiz
utcp-http
utcp-text
utcp-sse
Opening a WebSocket to a vendor
Running shell scripts
Loading a manual that was saved to a local JSON file
16. What is the license and governance model of UTCP?
The UTCP documentation site is published under Apache-2.0, except for the API reference docs, which are under MPL-2.0. The project lives in an open GitHub organisation with separate repositories for the specification and each language SDK.
Changes to the specification go through an RFC process, and the community gathers on GitHub discussions and Discord. That open process is why the spec has versioned docs (0.1, 1.0, 1.1) and migration guides between them.
Apache-2.0 is permissive, so companies can embed the SDKs in commercial products without copyleft obligations, which matters for enterprise adoption.
Take quiz
Private vendor approval only
Automatic nightly merges
An open RFC process
Apache-2.0
GPL-3.0 only
A proprietary commercial license
17. Which programming languages have UTCP SDKs?
The UTCP GitHub organisation hosts implementations in several languages. The docs call out Python, TypeScript and Go, and the ecosystem notes also list Rust.
Because the standard is language-agnostic JSON plus protocol plugins, a manual written once works with any compliant client. The TypeScript SDK additionally ships a Code Mode library for agents that write code.
Maturity differs by language, so look at each repository's release notes before betting a production system on one.
If your language has no official SDK, the protocol is plain JSON plus common transports, so a minimal client is feasible, though you would lose the plugin ecosystem.
Take quiz
It is language-agnostic JSON interpreted by compliant clients
Each SDK compiles it to the same binary
Manuals are tied to a single runtime
Rust only
TypeScript
None of them
18. What is Code Mode in UTCP?
Code Mode is a pattern, shipped as the @utcp/code-mode library, where the model is given one tool: run a TypeScript program in a sandbox that already has your UTCP and MCP tools wired in.
Instead of emitting one JSON tool call per turn, the model writes a single script that calls several tools, loops, filters results and returns only what matters. The library's authors report fewer round trips and lower token use on multi-step tasks; treat the exact percentages as vendor figures to verify on your own workloads.
The client entry point is callToolChain, and searchTools lets the agent load only the tool interfaces it needs.
Take quiz
A new UTCP manual for every request
A TypeScript program that calls tools inside a sandbox
A SQL query against the tool registry
registerGateway
compileManual
callToolChain
19. How does UTCP differ from MCP?
The core difference is architecture. UTCP describes how to call a tool directly, while MCP standardises a server that sits between the agent and the tool.
| Aspect | UTCP | MCP |
| Model | Manual describing direct calls | Server that wraps tools |
| Path | Agent to tool | Agent to MCP server to tool |
| Transport | HTTP, SSE, CLI, text and more via plugins | JSON-RPC over stdio or HTTP |
| Extras | Tool calling focus | Also resources and prompts |
UTCP's own documentation argues its approach cuts infrastructure and keeps native auth. MCP's strengths are strict standardisation, centralised control and features beyond tool calling. Both can coexist, since UTCP has an MCP plugin.
Take quiz
Native CLI execution
Automatic OpenAPI conversion
Resources and prompts
Direct, with no intermediate protocol server
Always through a UTCP gateway
Always through a JSON-RPC server
20. How does the UTCP discovery and call flow work?
The flow has four moves: discover, learn, call, respond.
- The client fetches the manual from the provider or file.
- It registers the tools and their call templates.
- When the agent picks a tool, the client resolves variables and builds the native request.
- The API answers normally and the client returns the result.
sequenceDiagram participant A as Agent participant C as UTCP Client participant M as Manual Source participant T as Tool API C->>M: Fetch manual M-->>C: Tools and call templates A->>C: search_tools and pick a tool A->>C: call_tool with arguments C->>T: Native request built from template T-->>C: Native response C-->>A: Result
Notice that the provider only participates in step one. After that, the client talks to the real API.
Search is optional but typical. With a small catalogue you can list every tool, while with a large one the client ranks tools against the task. Errors come back as the API's own errors, because the client does not translate them into a protocol-specific format.
Take quiz
During discovery, when the client fetches the manual
On every single tool call
Only when an error occurs
The tool provider's proxy
The UTCP client, from the call template and the supplied arguments
The LLM provider
21. Why does UTCP not need wrapper servers?
Because the manual already contains everything required to make the call: the URL, method, headers, auth and argument mapping. A client can build that request itself, so nothing has to translate on its behalf.
A wrapper server exists to receive a protocol-specific request and re-issue it to the real API. When the client speaks the API's native protocol, that translation hop has no job left. The API's existing gateway, rate limits and logging stay in force.
The one piece of infrastructure you may add is a route that serves the manual, and even that can be a static file or a converted OpenAPI spec.
Take quiz
The LLM calls the API from inside its weights
The manual carries complete call instructions the client can execute
The tool is moved into the client process
A dedicated server per tool
A new authentication provider
A route or file that serves the manual
22. How does JSON Schema fit into UTCP tool definitions?
A tool's inputs field is a JSON Schema object. It tells the agent which arguments exist, their types and which are required. The optional outputs field does the same for the return value.
That schema serves two audiences. The model reads it to decide what to send, and the client or provider can validate arguments against it. The security guide suggests tightening schemas with maxLength, pattern, numeric bounds and additionalProperties: false.
"inputs": { "type": "object", "properties": { "email": {"type": "string", "format": "email", "maxLength": 254} }, "required": ["email"], "additionalProperties": false }
Keep schemas honest. Leave optional fields out of required, trim properties the tool does not need, and use enum for fixed choices, since models tend to fill in every property they see and enums cut down invented values.
Take quiz
Allows any extra arguments silently
Disables the required list
Rejects arguments that are not declared in the schema
Both the model choosing arguments and any validator checking them
Only the network layer
Only the manual hosting server
23. How are tool arguments mapped to HTTP requests in UTCP?
The HTTP call template applies simple rules. Arguments that match {name} placeholders in the URL path fill those slots. Remaining arguments go to the query string for GET requests, or into the request body for POST, PUT and PATCH.
When a tool needs a specific argument to become the whole body, set body_field to that argument's name.
{ "call_template_type": "http", "url": "https://api.example.com/users/{user_id}/notes", "http_method": "POST", "body_field": "body" }
So a call with user_id and body hits the user's path and sends body as the payload.
Argument values can also be used in headers, which suits APIs that expect tenant or request IDs there. Test one GET tool and one POST tool, because argument routing differs between them.
Take quiz
Into the query string
Into the request body
They are dropped
Which header carries the token
Which tool argument holds the request body data
Which HTTP verb to use
24. How does UTCP handle OAuth2 credentials?
An oauth2 auth block gives the client a client id, secret, token URL and optional scope. The client fetches an access token and attaches it to calls, so the secrets stay in configuration rather than in the agent's prompt.
The security guide adds several safeguards that reference clients apply:
- the token endpoint must satisfy the HTTPS-or-loopback rule before any credential is sent
- redirects from the token endpoint are handled under the same rule
- tokens are cached per full credential configuration, never shared just because two configs use the same client id
That last point prevents one configuration from borrowing another's token.
Take quiz
To keep tokens valid forever
So configs that only share a client id never share tokens
Because tokens cannot be refreshed
A CAPTCHA
A manual_version comparison
The HTTPS-or-loopback destination check
25. How do you expose an existing REST API to UTCP agents?
You have two low-effort routes and neither touches your API's business logic.
- Reuse OpenAPI. If you already publish a spec, point the client's manual call template at it and the spec is converted into tools automatically.
- Add a discovery endpoint. Serve a manual from
GET /utcpthat lists tools and references your real URLs.
A third option is to convert the spec once with OpenApiConverter, save the manual as JSON and load it through the text call template, which suits specs that rarely change.
Whichever route you take, describe each tool clearly and keep authentication on the API itself.
Take quiz
Writing an MCP wrapper
Rewriting the API in TypeScript
Pointing the client at your existing OpenAPI document
When the API spec rarely changes
When the API changes every request
When you want to avoid JSON
26. How does the UTCP MCP plugin enable interoperability?
The utcp-mcp plugin lets a UTCP client treat MCP servers as another tool source. You register an MCP call template whose config lists the servers, and their tools appear next to native UTCP tools.
{ "call_template_type": "mcp", "config": { "mcpServers": { "server_name": { "transport": "stdio", "command": ["python", "-m", "my_mcp_server"] } } } }
This is the basis of the hybrid and migration story: keep legacy MCP servers running while new tools use direct HTTP or CLI templates. Server URLs follow the same HTTPS-or-loopback rule, and processes should be sandboxed.
Remember the trade-off. Tools reached through MCP still pay MCP's server overhead and follow MCP's behaviour. The plugin gives you one client interface, but the direct-call benefits only arrive once a tool moves to a native template.
Take quiz
The MCP servers the client should connect to
The OpenAPI paths to convert
The OAuth scopes to request
Replacing the UTCP manual format
Using MCP tools and native UTCP tools through one client
Disabling authentication
27. When should you use SSE or streamable HTTP in UTCP?
Use them when a tool returns data over time instead of in a single reply: log tails, live feeds, progress events. Both are provided by the utcp-http plugin.
A standard HTTP template waits for one response. An SSE template keeps the connection open and collects events until the stream ends, the timeout hits or a limit such as max_events is reached.
{ "call_template_type": "sse", "url": "https://api.example.com/logs/stream", "timeout": 300 }
Authenticate these connections, cap events and set timeouts. An open stream is an easy way to tie up resources.
Pick plain HTTP when the answer is small and bounded. Pick SSE when partial results are useful as they arrive, and accept the cost of managing a longer-lived connection.
Take quiz
A one-off lookup returning a single record
A log tail that emits events over time
A file read from disk
verify_ssl set to false
A larger tool description
A timeout and an event cap
28. How does UTCP search for relevant tools?
The client exposes search_tools, which takes a task description and returns the most relevant registered tools. This matters once you have dozens or thousands of tools and cannot paste them all into a prompt.
The ranking logic is a pluggable search strategy, so you can swap in your own, for example one that uses embeddings. Tool names, descriptions and tags are the raw material, which is why good descriptions pay off.
Typical agent loop: search, show the model only the top few tools, let it choose, then call.
Keep descriptions concrete: 'create a refund for an order' ranks better than 'handles payments'. Re-test retrieval after adding large batches of tools, because new entries can crowd out older matches.
Take quiz
It encrypts the tool list
It removes the need for manuals
It avoids placing every tool definition in the prompt
By plugging in a custom search strategy
By editing the HTTP plugin
By changing the manual_version
29. When should you choose UTCP over MCP?
UTCP fits best when you already have working APIs and want agents to use them with the least new infrastructure.
- You have existing REST or OpenAPI services.
- You want to keep your own auth, scaling and monitoring.
- You need several protocols (HTTP, CLI, SSE) behind one client.
- You have limited capacity to run and monitor extra servers.
- You want agents calling tools quickly with minimal code changes.
Treat the project's own cost and latency comparisons as a starting hypothesis. Measure with your workload, because a direct call is only faster if the extra hop was your real bottleneck.
A quick test: if the need sounds like 'call these existing endpoints', UTCP is probably enough. If it sounds like 'serve context, prompts and tools from one standard server', look at MCP.
Take quiz
Existing OpenAPI services you want agents to call with no new servers
A closed ecosystem needing MCP resources and prompts
A team that wants every call centrally proxied
As guaranteed production SLAs
As a hypothesis to verify with your own measurements
As irrelevant marketing with no basis
30. When would you choose MCP over UTCP?
MCP is the better pick when the things UTCP deliberately leaves out are exactly what you want.
- You need resources and prompts, not just tool calls.
- You want strict protocol standardisation across every tool.
- You prefer centralised control over what agents can reach.
- Your clients and tooling are already built around MCP servers.
- You are building a closed ecosystem where you own both sides.
A central server can also be a feature: one place to enforce policy and log access. UTCP trades that for directness. The two are not exclusive, since UTCP can call MCP servers through its plugin.
Take quiz
Calling a REST API with no extra servers
Exposing resources and prompts alongside tools
Wrapping a local shell script only
Zero added network hops
Automatic OpenAPI conversion
One place to enforce policy and log tool access
31. Why does UTCP add tags and average_response_size to tools?
These fields exist because agents consume tools differently than humans reading API docs.
tags let a client group and filter tools, which helps search_tools narrow a large catalogue before the model sees anything. For example, tags such as billing or read-only can steer selection.
average_response_size hints at how big a reply usually is, so the client or agent can budget context and avoid calling a tool that will flood the window. Both are optional metadata, but they are two of the concrete ways UTCP goes beyond plain OpenAPI.
Neither field changes how a call is made. They guide selection and planning, so leaving them out never breaks execution.
Take quiz
Setting the HTTP timeout
Choosing the auth type
Planning resource and context use before a call
They allow grouping and filtering when searching for tools
They encrypt tool output
They set the manual version
32. What happens when a UTCP client registers a manual?
Registration turns a pointer to a manual into usable tools.
- The client reads the manual call template (for example an HTTP URL, a file or an OpenAPI document).
- The matching protocol plugin fetches and parses the manual.
- OpenAPI input is converted into UTCP tools.
- The tools and their call templates are stored in the tool repository.
- They become visible to
search_toolsand callable by name.
Because the repository is pluggable, storage can be in memory or something shared. Re-registering a source refreshes its tools.
If a source is unreachable or its manual fails validation, registration for that source should fail and its tools will not appear, so check the result before assuming the tools exist.
Take quiz
In a tool repository
Inside the manual file only
In the model's weights
It is rejected unless wrapped
It is converted into UTCP tools
It is ignored in favour of MCP
33. How do you load secrets into a UTCP client configuration?
Keep real values out of manuals and source control. Manuals reference ${VAR} placeholders, and the client resolves them from its variables block or from files named in load_variables_from.
manual_call_templates: - name: weather_service call_template_type: http url: https://api.weather.com/utcp variables: WEATHER_API_KEY: your-api-key load_variables_from: - variable_loader_type: dotenv env_file_path: .env
In practice, put the key in .env or your secret manager and leave the inline example value out. The security guide also suggests restricting which variable names are allowed and logging access.
Keep a separate variable set per environment, such as dev and prod, so a staging key can never hit production APIs. Rotate keys on a schedule and avoid logging resolved values.
Take quiz
manual_call_templates
load_variables_from
tool_call_template
Hardcoded inside the manual
Inside the tool description
In .env or a secret store referenced by ${VAR}
34. What changed between UTCP v0.1 and v1.0?
The headline change is architectural. Early UTCP described tools through providers bundled in one Python package, with provider types such as http, sse and a few work-in-progress ones. Version 1.0 reorganised around call templates and a modular plugin system.
- a small core package with protocols in separate plugins (
utcp-http,utcp-cli,utcp-mcp) - manuals that carry
tool_call_templatefor each tool - pluggable repositories and search strategies
- SDKs in more than one language
Version 1.1 followed with its own migration guide. For exact field renames, follow the official guides rather than guessing.
In practice, treat the move as a small project: upgrade the SDK, regenerate or edit the manuals, adjust client config, then rerun your tool tests.
Take quiz
Gateways
Resource handlers
Call templates
As separate plugin packages
Compiled into a single binary
As browser extensions
35. What is the difference between manual_version and utcp_version?
They version two different things.
| Field | Meaning | Example |
manual_version |
Version of the provider's own manual content | 1.0.0 |
utcp_version |
Version of the UTCP specification the manual follows | 1.0.1 |
Bump manual_version whenever you add, remove or change tools. Change utcp_version only when you adopt a newer protocol release. Clients can use the second field to judge whether they understand the document's format.
Treat the manual as a versioned artifact. A changelog beside manual_version helps teams know when agents should refresh cached tools.
Take quiz
When the set or details of tools change
Only when the TCP port changes
Never after the first release
The version of the target API
The UTCP spec release the manual conforms to
The client's package version
36. How do you secure a UTCP manual discovery endpoint?
Manual endpoints are discovery targets: they reveal which tools exist and how they are called. Treat them as sensitive.
- Require authentication on the manual endpoint.
- Validate discovery tokens.
- Return only tools the caller is authorised to see.
- Filter by user permissions rather than publishing one global manual.
- Log every discovery attempt.
Hiding a tool from the manual is not a substitute for enforcing authorisation on the tool itself. Keep per-tool auth on the real endpoint as well.
Protect discovery with the same stack as the API itself, such as OAuth, gateway rules or mTLS. Reviewing discovery logs is also a good way to spot scanners enumerating your tools.
Take quiz
Every tool regardless of caller
Only the tools the caller is allowed to use
An empty list always
Yes, undiscovered tools cannot be called
Yes, if the URL is long
No, the tool endpoint must still enforce its own authorisation
37. Explain the trust boundary UTCP reference clients enforce?
Reference clients apply a fixed set of destination rules no matter what a manual or config says. The point is that a malicious or careless manual cannot talk the client into unsafe connections.
| Rule | What it means |
| Allowed destinations | Every URL (manual discovery, tool calls, OAuth2 token endpoints, MCP servers) must be HTTPS/WSS, or plain HTTP/WS to a literal loopback address only |
| Redirects | Each hop is re-validated and credentials (headers, cookies, query keys, bodies) are not forwarded across origins |
| Loopback | A manual found on a non-loopback origin cannot declare loopback tool or server URLs |
| OAuth2 | Token endpoints are validated before credentials are sent; tokens cached per full configuration |
| MCP | Sessions are isolated per server configuration and credentials |
Design your tools and manuals with these rules in mind. For instance, a staging manual served over plain HTTP from a non-loopback host will simply be rejected, so use HTTPS even in test environments.
Take quiz
Any host on a private network
Any host with verify_ssl disabled
A literal loopback address
They are not forwarded to the new origin
They are copied automatically
They are logged to the manual
38. Why can't a remote UTCP manual declare loopback tool URLs?
If it could, a manual fetched from an untrusted host could point your tools at 127.0.0.1 and make the client call services running on your own machine: local admin panels, databases with HTTP interfaces, development servers. That is a server-side request forgery style attack launched through a manual.
The rule works like this:
- A manual or OpenAPI spec discovered from a non-loopback origin may not declare tool or server URLs on the loopback interface.
- The local-development exemption is decided by the final origin after redirects.
- A loopback URL that redirects to a remote origin therefore does not keep the exemption.
Developers can still point a client at a locally served manual that calls local tools, which keeps the normal dev workflow intact.
Take quiz
A remote manual steering the client at services on the user's own machine
Brute-forcing OAuth client secrets
Denial of service against the manual host
By the first URL typed in the config
By the final origin after redirects
By the manual's utcp_version
39. How do you secure the UTCP CLI call template against command injection?
The CLI protocol runs real commands with model-influenced arguments, so the guide marks it as high risk. Defence is layered.
- Use absolute paths for executables so a modified PATH cannot swap them.
- Sanitise every argument: strip or reject shell metacharacters such as
;,&,|, backticks,$, brackets and redirects. - Validate arguments against expected patterns and length limits before they reach the command.
- Run in a sandbox with a fixed
working_dirand a minimalenv_varsset. - Apply strict timeouts, check exit codes and use a low-privilege user.
{ "call_template_type": "cli", "commands": [ {"command": "/usr/local/bin/safe-script --input UTCP_ARG_value_UTCP_END", "append_to_final_output": true} ], "working_dir": "/safe/sandbox", "env_vars": {"PATH": "/usr/local/bin:/usr/bin", "HOME": "/tmp/sandbox"} }
Where possible, prefer parameterised execution over building command strings, and expose narrow, single-purpose commands instead of a generic shell.
Test with hostile input such as semicolons, subshell syntax and very long strings, and confirm each is rejected before any process starts.
Take quiz
Because relative paths are slower
So a manipulated PATH cannot substitute a different executable
Because UTCP forbids installed programs
A generic 'run any shell string' tool
An unrestricted command running as root
A narrow single-purpose command with validated arguments in a sandbox
40. How do you protect the UTCP text call template from path traversal?
The text template reads files, so a manipulated file_path such as ../../etc/passwd could expose things it should not. Validate the path before opening anything.
- Resolve the requested path to an absolute path.
- Resolve symbolic links first so a link cannot escape.
- Check the result sits inside an allow-listed directory.
- Treat any path-resolution error as a denial.
- Enforce file size limits and extension allow-lists.
from pathlib import Path ALLOWED = Path("/safe/data").resolve() def is_allowed(requested: str) -> bool: try: target = (ALLOWED / requested).resolve() return target.is_relative_to(ALLOWED) except Exception: return False
Validate after resolving, not before. Checking the raw string for .. misses encoded and symlink-based escapes.
Cap file sizes so a tool cannot push a huge file into an agent's context, and log denied attempts, since repeated traversal tries are a useful alarm signal.
Take quiz
Before any normalisation, on the raw string only
Never, the OS handles it
After resolving the absolute path and symlinks
Deny the request
Allow it and log a warning
Retry with a shorter path
41. What happens when a UTCP request is redirected to another origin?
The client treats a redirect as a new connection, not a continuation. Each hop is checked against the same destination rule (HTTPS/WSS, or loopback-only plain HTTP/WS), so a redirect cannot downgrade the connection to unsafe plain HTTP on a remote host.
Credentials are also protected. Auth headers, cookies, query-string keys and request bodies are not forwarded across origins, so an API key sent to api.example.com never leaks to a different host the response bounced to.
For OAuth2, redirects from the token endpoint are handled under the same rule, and for MCP's token flow they are refused outright. If your API legitimately moves between hosts, update the manual to the new URL rather than depending on redirects carrying auth.
To verify this in testing, point a manual at a URL that redirects to a different host and confirm that no auth header reaches the second host.
Take quiz
It is not forwarded to the new origin
It is forwarded automatically
It is replaced by an anonymous key
It is trusted because the first hop passed
It is re-validated against the destination rules
It is blocked in all cases
42. Explain the execution flow of UTCP Code Mode?
Code Mode swaps many JSON tool calls for one code-execution tool. The model sees a single capability and writes a TypeScript program using your tools as typed functions.
flowchart TD A["User task"] --> B["LLM writes TypeScript"] B --> C[callToolChain] C --> D["Sandbox runs the script"] D --> E["Script calls UTCP and MCP tools"] E --> F["Results stay inside the script"] F --> G["Script returns final result and logs"] G --> H["LLM answers the user"]
The sandbox has the registered tools wired in, with auto-generated TypeScript interfaces and runtime introspection so the model can look up a tool's signature on demand. Intermediate results stay in the script's variables instead of passing back through the model's context.
That is where the claimed gains come from: fewer LLM round trips and fewer tokens. The trade-off is that you now run model-written code, so the sandbox and the tools it can reach become your security boundary.
Plan observability up front: keep the generated script and its console output with each run, because debugging a failed chain means reading the code the model wrote. Set execution time limits, restrict network and filesystem access inside the sandbox and register only the tools the task needs.
Take quiz
In the prompt for every turn
Inside the script's variables, not the model context
In the UTCP manual
The manual becomes unreadable
Tools can no longer be discovered
Executing model-written code, so sandboxing becomes critical
43. How can you optimize token usage with large UTCP tool catalogues?
Loading hundreds of tool definitions into every prompt is the expensive mistake. UTCP gives you several ways to avoid it.
- Search before exposing. Use
search_toolsand show the model only the top few matches. - Tag and describe well. Short, distinctive descriptions and useful tags make retrieval accurate, so you can show fewer candidates.
- Use Code Mode. Let the model introspect interfaces on demand and batch several calls in one script.
- Mind response sizes. Use
average_response_sizeto avoid tools that return huge payloads, and trim output inside the script. - Cache discovery. Register manuals once and reuse the repository.
Measure tokens per task before and after. Retrieval that misses the right tool costs more than it saves.
Watch for tool-selection drift too. Trimming tags or descriptions to save tokens can reduce retrieval accuracy, so rerun a regression set of typical tasks after each change.
Take quiz
Concatenate every manual into the system prompt
Remove all tool descriptions
Retrieve a few relevant tools with search_tools instead of listing all
The right tool may be missed, forcing extra calls
The manual stops validating
The client loses HTTPS
44. Explain the internal working of the UTCP client?
The client is a thin coordinator over pluggable parts. Roughly, a call travels like this.
flowchart LR CFG["Config and variables"] --> REG["Register manual sources"] REG --> PROTO["Protocol plugin per call template type"] PROTO --> REPO[(Tool repository)] Q[search_tools] --> SS["Search strategy"] SS --> REPO CALL[call_tool] --> RES["Resolve variables and arguments"] RES --> PROTO PROTO --> API["Native tool or API"]
Registration uses a communication protocol plugin matching each manual source's call_template_type to fetch and parse manuals. Tools land in a tool repository that is itself an interface, so storage can be swapped.
Search runs through a replaceable search strategy. Execution resolves ${VAR} values and tool arguments, picks the plugin named in the tool's template, applies auth and sends the native request.
The main interfaces in the core package are the communication protocol, the concurrent tool repository and the search strategy. Everything else is configuration.
That separation is the point: the agent only sees search_tools and call_tool while plugins handle protocol details. Swapping an in-memory repository for a shared one, or keyword search for embeddings, needs no change to manuals or the agent loop.
Take quiz
The tool repository
The search strategy
The call template itself
A random plugin from the list
The call_template_type in the tool's template, handled by its plugin
The LLM's temperature setting
45. How do you build a custom protocol plugin for UTCP?
Extending UTCP to a new transport follows three steps from the implementation guide.
- Define a call template. Choose a unique
call_template_typeand the fields your protocol needs (host, topic, timeout, auth). - Implement the communication handler. Write the logic that registers manuals (if the protocol serves them) and executes calls, mapping arguments to the wire format.
- Register the protocol. Make it available to the client so templates of that type are routed to your handler.
{ "call_template_type": "custom", "custom_field": "value", "timeout": 30, "auth": {"auth_type": "api_key", "api_key": "${API_KEY}"} }
Keep the same safeguards the built-in plugins follow: validate destinations, support timeouts and avoid forwarding credentials across origins.
Test the plugin against a fake server first and cover timeout and error paths. Write a security section for your template the way the built-in docs do (destinations, credentials, input validation), and publish the template's fields so provider authors know which are required.
Take quiz
A new HTTP verb
A unique call_template_type value
A separate manual_version
Publishing a blog post
Renaming the tools
Registering the protocol with the client
46. How would you migrate from MCP to UTCP incrementally?
Don't switch overnight. The UTCP docs describe a phased plan that keeps everything working while you move.
flowchart LR A["1 Assess MCP servers"] --> B["2 Hybrid: UTCP client plus MCP plugin"] B --> C["3 Migrate tools one by one to native UTCP"] C --> D["4 Retire MCP servers"]
- Assess. Inventory servers and pick high-value tools.
- Hybrid. Install UTCP with the MCP plugin and confirm existing tools work through it.
- Migrate. Add manuals or
/utcpendpoints for the underlying APIs and update client configs. - Clean up. Deprecate servers you no longer need and monitor.
Not every server should go. If a tool depends on MCP-only features such as resources or prompts, keep it behind the plugin.
Keep a rollback plan: leave the MCP server definition in config, disabled, until the native tool has run cleanly under real traffic. During the hybrid phase compare outputs from both paths to catch differences such as error formats or field names.
Take quiz
The CLI call template
A manual with no tools
The utcp-mcp plugin
Those relying on MCP-only features like resources or prompts
Those with the shortest names
Those already returning JSON
47. What are the security trade-offs of UTCP's direct-call model?
Removing the middleman changes the security picture rather than just improving it.
| Gains | Costs |
| No proxy to compromise | Clients must handle several auth methods |
| Existing API controls stay intact | Manual endpoints become discovery targets |
| Smaller attack surface | Variable substitution adds injection risk |
| Existing logging keeps working | No central choke point for policy by default |
To compensate, secure manual discovery, validate every argument, lock down CLI and text protocols and rely on the client's destination rules. If you need central policy, put it at your API gateway, or accept that an MCP-style server gives you one place to enforce it. Which model is safer depends on how well your existing API security is run.
A practical posture: treat the manual as untrusted input to the client, treat tool arguments as untrusted input to the API, and put rate limits and audit logs on both sides.
Take quiz
Clients must manage multiple authentication methods
It disables HTTPS
It requires a wrapper per tool
Inside the manual's tags
At your existing API gateway
In the model's system prompt only
48. How should you evaluate UTCP versus MCP performance claims?
Start by noticing the source. The comparison tables on the UTCP site, including the latency and resource figures, are published by the UTCP project and read as illustrations rather than independent benchmarks. The Code Mode percentages come from that library's own README and project listings.
A sound evaluation looks like this:
- Define the task: tool count, call pattern, response sizes, concurrency.
- Test the same tools via UTCP direct, via an MCP server and, if relevant, via the MCP plugin.
- Measure end-to-end latency, tokens per task, error rate and operational cost, not only the network hop.
- Run enough trials to see variance, and include cold starts.
- Check where time really goes. LLM inference often dwarfs one extra network hop.
The extra hop is real, but it may not be your bottleneck.
Take quiz
They were audited by a standards body
They are the project's own figures, so verify on your workload
They only apply to Rust
The number of GitHub stars
The logo colour
Tokens consumed per task, not only network latency
49. How do you troubleshoot an unresolved variable in a UTCP call?
A failing call that mentions a missing ${VAR} or an unfilled {arg} placeholder is almost always a configuration slip. Work through it in order.
- Identify the syntax.
{arg}comes from tool arguments,${VAR}from config or environment. - Check the argument. Make sure the agent actually passed a value for each
{arg}in the URL, and that the input schema marks it required. - Check the variable source. Confirm the name exists in
variablesor in the file referenced byload_variables_from, with exact spelling and case. - Check the loader path. A wrong
env_file_pathfails quietly more often than you would think. - Retest in isolation. Call the tool directly with known-good values before involving the model.
If the value is present but rejected, look at the substitution safeguards: values with characters like <, quotes or ; may be refused when sanitisation is on.
Take quiz
${VAR}
UTCP_VAR(arg)
{arg}
A misspelled name or a wrong env_file_path
The tool has too many tags
The manual_version is too high
50. How do you troubleshoot UTCP manual discovery failures?
When a client cannot load tools from a source, check the layers from the outside in.
- URL and scheme. Remote manuals must use HTTPS. Plain HTTP only works to a literal loopback address.
- Authentication. A protected manual endpoint needs credentials or a discovery token. A 401 or 403 here is a config problem, not a UTCP bug.
- Redirects. A redirect to another origin is re-validated and drops credentials, so the manual may load without auth and fail.
- Loopback declarations. A remote manual listing loopback tool URLs is refused.
- Document shape. Confirm valid JSON with
toolsandtool_call_templatefields and a supportedutcp_version. - Plugin presence. The plugin for the manual's call template type must be installed.
Fetch the manual with curl first. If that works but the client fails, the problem is almost certainly one of the client-enforced rules above.