Skip to main content
Beyond tools, FrontMCP supports prompts (reusable LLM instructions) and resources (data that LLMs can read). This guide shows you how to create and combine them with tools for powerful workflows.
Prerequisites:

What You’ll Build

An expense management app with:
  • A prompt that generates expense reports
  • A resource template that fetches expense details by ID
  • A static resource that returns expense policies

Prompts

Prompts provide pre-built instructions that LLMs can use. They’re perfect for consistent formatting, complex workflows, or domain-specific guidance.

Creating a Basic Prompt

Prompt Arguments

Define the inputs your prompt accepts:

Prompt Return Value

Prompts return an object with: Each message has:
  • role: 'user' or 'assistant'
  • content: Object with type: 'text' and text: string

Resources

Resources expose data that LLMs can read. There are two types:

Static Resources

Fixed content at a specific URI:

Resource Templates

Dynamic resources with URI parameters:
The {expenseId} in the URI template becomes a parameter passed to execute().

Combining Everything in an App

Register prompts and resources alongside tools:

Example: Categorization Prompt

Here’s a prompt that helps LLMs categorize expenses:

Example: Categories Resource

A static resource listing available categories:

File Organization

Recommended structure:
Use barrel exports in index.ts files:

Best Practices

Names should indicate what the prompt/resource does:
Help LLMs understand when to use each prompt/resource:
Match the content type:
  • text/markdown for formatted text
  • application/json for structured data
  • text/plain for simple text
Add validation in your execute method:

Next Steps

Role-Based Authorization

Control access to prompts and resources

Prompts Reference

Full @Prompt decorator documentation

Resources Reference

Full @Resource decorator documentation

Testing

Test prompts and resources