Get Started

Managed Skills

Build a strongly typed AI skill (Function Tool or MCP Tool) and deploy it to Vivgrid's global network in minutes with Yomo and the viv CLI.

Managed Skills are the tools your AI agent can call to act on the real world. On Vivgrid, a skill can be a Function Tool (via the function calling API) or an MCP Tool (via the Model Context Protocol). This guide walks you through building and deploying your first skill.

Set Up Your Development Environment

Start by writing your first skill.

Prepare

Write Your First Skill

First run yomo init -l node ./llm-tool to initialize your skill project.

A skill is a Node.js project with three exports in src/app.ts: a description, an Argument type, and a handler. The Yomo CLI turns these exports into a discoverable, LLM-callable function—no server boilerplate required.

export const description = `Get current weather for a given city. If no city is provided, you 
	should ask to clarify the city. If the city name is given, you should 
	convert the city name to Latitude and Longitude geo coordinates, keeping 
	Latitude and Longitude in decimal format.`

export type Argument = {
  city: string
  latitude: number
  longitude: number
}

async function getWeather(args: Argument) {
  console.log('->city: ', args.city, 'latitude: ', args.latitude, 'longitude: ', args.longitude)
  try {
    const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?lat=${args.latitude}&lon=${args.longitude}&appid=${process.env.OPENWEATHERMAP_API_KEY}&units=metric`)
    if (!response.ok) {
      return 'can not get the weather information at the moment'
    }
    const data = await response.json()
    return JSON.stringify({ city: args.city, ...data })
  } catch (error) {
    console.error(error)
    return 'can not get the weather information at the moment'
  }
}

/**
 * 
 * Handler orchestrates the core processing logic of this function.
 * @param args - LLM Function Calling Arguments(optional).
 * @returns The result of the retrieval is returned to the LLM for processing.
 */
export async function handler(args: Argument) {
  const result = await getWeather(args)
  return result
}

Run Locally or on a Self‑Managed Server

Create a .env file to supply the API keys your skill needs:

OPENWEATHERMAP_API_KEY=<YOUR_OPENWEATHERMAP_API_KEY>

Then install dependencies and run the skill, connecting it to Vivgrid with your APP_KEY:

yomo run \
  --name tool_get_weather \
  --zipper zipper.vivgrid.com:9000 \
  --credential <VIVGRID_APP_KEY>

Deploy Globally as Managed Skills

Create a vivgrid.yml file in the root of your project directory, then run: viv deploy . --env OPENWEATHERMAP_API_KEY=<YOUR_OPENWEATHERMAP_API_KEY>.
An example vivgrid.yml file:

secret: <APP_SECRET>
tool: tool_get_weather

Test Your Skill

curl -v -i https://api.vivgrid.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <VIVGRID_TOKEN>" \
-d '{
	"messages": [{
		"role": "user", 
		"content": "how is the weather today in Paris and Tokyo?"
	}], 
	"stream": true
}'

On this page