8
9// Register prompt capabilities with server
10export function registerPrompts(server: McpServer, _config: Config) {
11 // Townie prompt
12 server.prompt(
5import {getErrorMessage} from "../lib/errorUtils.ts"
6
7export function registerSqliteTools(server: McpServer, config: Config) {
8 // Execute SQL
9 server.tool(
64 )
65
66 // Fix for sqlite-query function
67 server.tool(
68 "sqlite-query",
91 )
92
93 // Fix for sqlite-exec function
94 server.tool(
95 "sqlite-exec",
6import {z} from "npm:zod"
7
8export function registerValTools(server: McpServer, config: Config) {
9 // Get val by username and val name
10 server.tool(
8import {getErrorMessage} from "../lib/errorUtils.ts";
9
10export function registerCliTools(server: McpServer, _config: Config) {
11 // Watch files in a project for real-time updates
12 server.tool(
6import {z} from "npm:zod"
7
8export function registerBranchTools(server: McpServer, config: Config) {
9 // List all branches in a val
10 server.tool(
16 * 5. Clean up workspace
17 */
18async function performFileOperationWithCli(
19 config: Config,
20 valId: string,
88}
89
90export function registerFileTools(server: McpServer, config: Config) {
91 // List files in a val branch
92 server.tool(
5import {getErrorMessage} from "../lib/errorUtils.ts"
6
7export function registerBlobTools(server: McpServer, config: Config) {
8 // List blobs
9 server.tool(
5import {getErrorMessage} from "../lib/errorUtils.ts"
6
7export function registerUserTools(server: McpServer, config: Config) {
8 // Get user information by username
9 server.tool(
5import {getCliAvailability, runVtCommand} from "../lib/vtCli.ts"
6
7export function registerProjectTools(server: McpServer, config: Config) {
8 // List all projects
9 server.tool(
1This directory has crons that extract data from Notion and save that data to blob storage in val.town. Blob storage functions like a cache.
2
3# demoCache.ts
Simple functional CSS library for Val Town
A helper function to build a file's email
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.