route

route is a command for coding agents from ch-bas/kibana-plugin-helper. It costs 32 tokens per session (1,447 once invoked), scanned A, original, MIT.

A generator for Kibana server API routes, which are URL endpoints that receive requests and return data or perform actions.

In plain words
What is it for?
Use it to create GET, POST, PUT, DELETE, or PATCH endpoints that work with Elasticsearch, Kibana Saved Objects, or an external API, including common create, read, update, and delete operations.
Why use it?
It removes repetitive work around HTTP methods, request validation, authentication settings, error handling, and TypeScript types.

Command

Part of the kibana-plugin-helper plugin — 1 skill, 8 commands, 5 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/ch-bas/kibana-plugin-helper/route
Clone the repo
git clone --depth 1 https://github.com/ch-bas/kibana-plugin-helper

Or install kibana-plugin-helper, the plugin that ships this one along with the rest of its 1 skill, 8 commands, 5 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for route

README.md
[![agentmods](https://agentmods.dev/badge/commands/ch-bas/kibana-plugin-helper/route.svg)](https://agentmods.dev/commands/ch-bas/kibana-plugin-helper/route)
Your own site
<a href="https://agentmods.dev/commands/ch-bas/kibana-plugin-helper/route"><img src="https://agentmods.dev/badge/commands/ch-bas/kibana-plugin-helper/route.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,447 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00032 $0.01447
Opus 5 $0.00016 $0.00724
Sonnet 5 $0.00006 $0.00289
Haiku 4.5 $0.00003 $0.00145

Measured 4d ago against content hash 0d293278925c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

route scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/route.md · 227 lines

How it starts

The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generate Server Route

Create a server-side route for your Kibana plugin. Ask the user for:

  1. HTTP method: GET, POST, PUT, DELETE, PATCH
  2. Route path: e.g., /api/my_plugin/items or /api/my_plugin/items/{id}
  3. What it does: Brief description
  4. Request parameters:
    • Path params (from URL, e.g., {id})
    • Query params (e.g., ?page=1&perPage=20)
    • Body (for POST/PUT/PATCH)
  5. Response: What it returns
  6. Needs authentication? (default: yes)
  7. Data source: Elasticsearch, Saved Objects, or external API

Route Template

import { schema } from '@kbn/config-schema';
import type { IRouter } from '@kbn/core/server';

export function register{RouteName}Route(router: IRouter) {
  router.{method}(
    {
      path: '{route_path}',
      options: {
        tags: ['access:{plugin_id}'],
      },
      validate: {
        params: schema.object({
          // Path parameters
          id: schema.string(),
        }),
        query: schema.object({
          // Query parameters
          page: schema.number({ defaultValue: 1, min: 1 }),
          perPage: schema.number({ defaultValue: 20, min: 1, max: 100 }),
          search: schema.maybe(schema.string()),
        }),
        body: schema.object({
          // Body parameters (POST/PUT/PATCH)
          name: schema.string({ minLength: 1, maxLength: 255 }),
          enabled: schema.boolean({ defaultValue: true }),
        }),
      },
    },
    async (context, request, response) => {
      try {
        const coreContext = await context.core;
        const { id } = request.params;
        const { page, perPage, search } = request.query;
        const { name, enabled } = request.body;

        // Implementation here

        return response.ok({
          body: {
            // Response data
          },
        });
      } catch (error) {
        // Error handling
        if (error.output?.statusCode === 404) {
          return response.notFound({
            body: { message: error.message },
          });
        }
        return response.customError({
          statusCode: error.output?.statusCode || 500,
          body: { message: error.message },
        });
      }
    }
  );
}

Read the full file on GitHub · 227 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 227 lines · 32 tokens per session scan A 0d293278925c

Subscribe to this mod's changes

route is a command published in the GitHub repository ch-bas/kibana-plugin-helper (3 stars, last pushed 6mo ago), licensed MIT. It adds 32 tokens to every session and 1,447 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.