home / skills / trpc-group / trpc-agent-go / plan_route

This skill plans a route and returns distance and ETA in a deterministic JSON format for reliable agent planning.

npx playbooks add skill trpc-group/trpc-agent-go --skill plan_route

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
701 B
---
name: plan_route
description: Plan a route and return distance + ETA (schema + deterministic result).
---

# plan_route

This skill is used by the dynamic structured output demo.

## Output JSON Schema

```json
{
  "type": "object",
  "properties": {
    "route": {
      "type": "string",
      "description": "Route name"
    },
    "distance_km": {
      "type": "number",
      "description": "Distance in kilometers"
    },
    "eta_min": {
      "type": "integer",
      "description": "ETA in minutes"
    }
  },
  "required": [
    "route",
    "distance_km",
    "eta_min"
  ],
  "additionalProperties": false
}
```

## Commands

Print JSON result to stdout:

```bash
cat result.json
```

Overview

This skill plans a route and returns a deterministic JSON result containing the route name, total distance in kilometers, and ETA in minutes. It is designed for programmatic use where a strict JSON schema is required for downstream processing. The output is concise and machine-readable for integration with agent systems or travel tools.

How this skill works

Given origin and destination context from the caller, the skill computes a single route, estimates the distance in kilometers, and calculates an ETA in minutes. It then emits a JSON object that strictly follows the provided schema: route, distance_km, and eta_min. The result is deterministic and suitable for automated workflows that require predictable structured output.

When to use it

  • You need a single, deterministic route summary for automation or logging.
  • Integrating with agents or services that require a strict JSON schema response.
  • Providing quick distance and ETA estimates for dashboards or notifications.
  • Feeding route metadata into downstream systems that cannot handle multiple alternatives.
  • Testing or demoing structured output handling in agent frameworks.

Best practices

  • Provide clear origin and destination input to avoid ambiguous routing choices.
  • Use consistent units (kilometers for distance, minutes for ETA) when combining with other systems.
  • Validate inputs upstream to ensure deterministic behavior (fixed time, mode, and constraints).
  • Keep the consumer aware that this skill returns one planned route rather than multiple options.
  • Parse the JSON programmatically—do not rely on freeform text parsing.

Example use cases

  • A scheduled agent requests a commute estimate to include in a morning briefing email.
  • A monitoring tool logs route distance and ETA each time a delivery job is created.
  • A travel assistant populates a trip summary card showing route name, distance, and travel time.
  • A demo of structured output handling where an LLM-based agent queries route planning and consumes the JSON result.
  • An automation pipeline uses the ETA to schedule downstream tasks like notifications or resource allocation.

FAQ

What does the route field contain?

The route field contains a concise route name or identifier describing the path returned by the planner.

Are units fixed in the output?

Yes. distance_km is in kilometers (number) and eta_min is in minutes (integer) to ensure consistent, machine-readable values.