Tuesday, November 24, 2026SubscribeMastheadAbout
Cali ReporterCalifornia · National · West Coast · Good News

Advertisement

Technology

Resource Templates vs. Tools in API Design

This section explores the distinction between resource templates and tools in API design, based on insights from a Dev.to article.

Portrait of Benjamin Boyce
Artificial Intelligence & Technology · November 22, 2026
Share

AI-generated editorial illustration from an imagined camera angle.
AI-generated editorial illustration from an imagined camera angle. Source image: dev.to.

Resource templates are used when the model requires parameterized, read-only access to data that has an address, such as a file path or a record ID. A resource template is a fill-in URI that the host reads from, whereas a tool is a named function the model invokes. According to the Dev.to article, when a read could be modeled either way, the default should be a resource for addressable data and a tool for actions that may have side effects or require approval (Dev.to, 2023). [1]

Resources are the readable data a server exposes, each with a URI, a name, and an optional MIME type, and the client fetches it with a resources/read call. In contrast, tools are functions the model can call, each with a name, description, and input schema, and a tools/call runs it and returns structured content. The Dev.to article explains that resource templates are parameterized URIs, such as file:///{path} or https://api.example.com/users/{id}, allowing the model to supply the parameter, the host to build the URI, and the same read path to handle every value (Dev.to, 2023). [1]

Resource templates are preferred when the same data is read repeatedly, linked from elsewhere, or shown in a browser of available data. Tools are preferred when the read is really the start of a workflow, applies logic beyond a simple fetch, or must sit alongside write operations the model already calls. The Dev.to article notes that tools are the path models are most reliable at invoking automatically, because tool selection is built into the model's call loop (Dev.to, 2023). [1]

Resource templates are parameterized URIs that allow the client to construct a valid address by filling in the braces, such as file:///{path} or https://api.example.com/users/{id}. These templates are advertised by the server, and the model supplies the parameter, which the host uses to build the URI. This method ensures that the data remains addressable, as each fetched result points to a real URI that can be referenced, re-read, or cached. The use of resource templates is ideal for scenarios where the same data is read repeatedly, linked from elsewhere, or shown in a browser of available data. [1]

Advertisement

Tools, on the other hand, are named functions that the model invokes, often involving actions that may have side effects or require approval. Each tool has a name, description, and input schema, and is called through a tools/call operation. Unlike resource templates, tools do not inherently provide addressability, and their results are typically not cached. They are better suited for operations that start a workflow, apply logic beyond a simple fetch, or must be aligned with write operations the model already calls. The choice between a resource template and a tool is guided by the intent of the operation: addressable reads belong in resource templates, while actions that compute or change state belong in tools. [1]

The protocol does not enforce a hard rule that every read must be a resource; hosts vary in how they expose resources to the model. A resource being read-only is a convention the server is expected to honor, though the protocol does not guarantee that the handler never mutates state. Similarly, a resource template does not validate that the underlying data is current or correct. Connecting a server does not deploy a backend, and these primitives do not replace the real system the data comes from. Developers are advised to send calls and inspect the responses in a local workspace to confirm what a server actually returns for either primitive. [1]

Resource templates and tools can overlap in functionality, particularly in cases like a read by id, where both a resource template (e.g., users/{id}) and a get_user tool could be used. However, the semantics differ: a resource template treats the data as addressable and static, while a tool treats the operation as a function call that may involve logic or side effects. The decision to use one over the other should be based on the specific needs of the application, with resource templates preferred for addressable, parameterized reads and tools preferred for operations that require approval or have side effects. [1]

Sources

Dev.to

Prepared with AI assistance from the cited sources.

The Cali Reporter newsletter

The stories worth your time.

California, the country, and what comes next. Join our free newsletter for reporting that keeps you informed.

By joining, you agree to receive the Cali Reporter newsletter. Unsubscribe at any time. Privacy policy.

More in Technology

  • Modern Web Guidance 1.0 and Browser Compatibility

    Modern Web Guidance 1.0, announced by Chrome for Developers on November 10, introduces browser compatibility data to assist coding agents in building web features. The initiative emphasizes the importance of fallback…

  • Apache mod_http2 Vulnerability Detection with Nmap

    A new Nmap scripting module has been developed to detect the Apache mod_http2 vulnerability (CVE-2026-119618), addressing the challenges of identifying affected systems accurately.

  • Securing Remote Vendor Access in Industrial Networks

    Best practices for managing remote vendor access in operational technology (OT) networks emphasize controlled access points, multifactor authentication, and time-bound sessions to reduce cybersecurity risks.

Advertisement