Skip to main content

Overview

The resources.getById endpoint retrieves a specific skill resource by its unique identifier. Resources are files bundled with skills that contain reference documentation, scripts, assets, or other supporting content.

Endpoint

resources.getById
This is a tRPC query endpoint accessible through the skills router.

Input Parameters

id
string
required
The UUID of the resource to retrieveExample: "550e8400-e29b-41d4-a716-446655440000"

Response

The endpoint returns a resourceReadOutput object containing the resource data along with parent skill information and rendered content.
id
string
The unique UUID identifier for the resource
skillId
string
The UUID of the parent skill that owns this resource
skillSlug
string
The URL-friendly slug of the parent skill
skillName
string
The display name of the parent skill
path
string
The relative path of the resource within the skillExample: "scripts/setup.sh" or "reference/api-guide.md"
kind
enum
The type of resource. One of:
  • "reference" - Documentation or reference material
  • "script" - Executable script file
  • "asset" - Static asset (images, data files, etc.)
  • "other" - Other resource types
content
string
The raw content of the resource (original markdown with mentions)
renderedContent
string
The content with skill mentions rendered as links. This is the display-ready version with [[skill-name]] mentions converted to clickable links.
metadata
object
Custom metadata stored with the resource as key-value pairsExample: { "author": "Alice", "version": "1.0" }
createdAt
Date
Timestamp when the resource was created
updatedAt
Date
Timestamp when the resource was last modified

Example Usage

import { trpc } from './trpc';

const resource = await trpc.skills.resources.getById.query({
  id: '550e8400-e29b-41d4-a716-446655440000'
});

console.log(resource.skillName); // "Docker Setup"
console.log(resource.path); // "scripts/install.sh"
console.log(resource.kind); // "script"

Access Control

This is a protected endpoint that requires authentication. Users can only access resources from skills in vaults they have read access to.

Error Responses

NOT_FOUND
Returned when:
  • The resource ID doesn’t exist
  • The user doesn’t have access to the parent skill’s vault
  • skills.getById - Get a skill with all its resources
  • skills.getResourceByPath - Get a resource by skill slug and path
  • resources.create - Create a new resource
  • resources.update - Update an existing resource

Build docs developers (and LLMs) love