Skip to main content
Glama

Add a gateway route

portal_route_add
Idempotent

Route a private HTTP or file app on a stable gateway port, scoping it to the current portal owner. Sets up same-origin protection by default without inviting others or restarting the gateway.

Instructions

Route a private HTTP or file app on a stable gateway port. Makes the app people-scoped. HTTP MCP requires the current portal owner, checked in the write transaction. The same-origin gate defaults on. Does not invite anyone or restart the gateway node.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "app": "<app>"
    },
    "name": "portal_route_add"
  }
}

Input Schema

NameRequiredDescriptionDefault
appYes
portNo
allow_cross_originNoAllow browser calls from other origins; default false.

Output Schema

NameRequiredDescriptionDefault
portalYes
routesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.4.0
    • addedOutput schema / properties / portal / properties / owner_restored
      Added value: +{
      +  "description": "Owner login whose revocation this enable cleared, because the call named that owner.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / portal / properties / owner_revoked
      Added value: +{
      +  "description": "Recorded owner that stays revoked; restore with portal enable naming that owner.",
      +  "type": "string"
      +}
  2. Changed2 schema fields changedv0.3.0
    • addedOutput schema / properties / portal / properties / message
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / portal / properties / unavailable_apps
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  3. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare idempotent=true and destructive=false, but the description adds real context beyond them: the current portal owner is required and validated inside the write transaction, the same-origin gate defaults on, and the call does not invite users or restart the node. That is meaningful behavioral disclosure for a write tool. It does not say what happens on port conflicts or whether an existing route is replaced, which keeps it at 4.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action and scope lead, followed by constraint sentences in a sensible order, with no filler or repeated annotation restatements. Some lines are highly compressed ("Makes the app people-scoped", "The same-origin gate defaults on"), which trades a little clarity for brevity, so it is not a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With annotations covering safety and idempotency and an output schema covering return values, the description needs to carry only preconditions and side effects – which it does (owner requirement, no invite, no restart, default cross-origin gate). The remaining gap is port-conflict and replacement semantics, a modest omission for a 3-parameter tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 33% – only allow_cross_origin is documented in-schema, while app and port are bare. The description alludes to the same-origin default (reinforcing allow_cross_origin) and to a "stable gateway port," but never explains whether port is fixed, auto-assigned, or what happens if it is already in use. It partially compensates for the low coverage but leaves the two most important parameters under-specified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: routes a private HTTP or file app onto a stable gateway port, and adds people-scoping. This is clearly distinguishable from portal_route_list, portal_route_remove, and app_restart without opening any schema. It stops short of naming a sibling, so it stays at 4.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"Does not invite anyone or restart the gateway node" explicitly rules out two adjacent operations, which implicitly routes the agent to invite_user and app_restart for those follow-ups. It states the ownership precondition for HTTP MCP. There is no explicit statement of when to prefer adding a route versus other exposure mechanisms, so it is not a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.