# Set the visibility of a QiForge plugin's tools

> Control whether a QiForge plugin's tools are bound at boot, loaded on demand or never advertised, per plugin or per tool, and choose the right tier.

`manifest.visibility` sets the default for every tool the plugin ships, and individual tools can override it. It takes three values: `'always'`, `'on-demand'` (default) and `'silent'`. This recipe sets visibility on a plugin and on single tools, and helps you choose a tier.

<Steps>
  <Step title="Set plugin-wide visibility on the manifest">
    The manifest's `visibility` flag is the default applied to every tool the plugin returns.

    ```ts
    import type { PluginManifest } from '@ixo/oracle-runtime';

    const manifest: PluginManifest = {
      title: 'Weather',
      summary: 'Current weather + forecast lookups for cities.',
      whenToUse: ['Current weather', 'Forecasts', 'Outfit recommendations'],
      visibility: 'on-demand',
    };
    ```

    There are three tiers:

    - `'always'`: bound to the agent at boot and listed in the Tier-1 prompt.
    - `'on-demand'` (default): discoverable through `list_capabilities` and loaded through `load_capability`.
    - `'silent'`: not advertised. See the warning below.

    Canonical source: [weather.plugin.ts](https://github.com/ixoworld/ixo-oracles-boilerplate/blob/main/apps/qiforge-example/src/plugins/weather/weather.plugin.ts).

    <Warning>
      `'silent'` controls advertising, not access. It is not a security boundary. A silent plugin is left out of the Tier-1 capability block, excluded from `list_capabilities` (by default), and rejected by `load_capability`. But if a silent plugin returns tools, the capability gate passes them straight through to the model, exactly like `'always'`-tier tools. Use `'silent'` for transport, middleware or Nest-module plugins (for example Slack transport, credits and billing) that have nothing to advertise to the agent. Never use it to "hide" a sensitive capability.
    </Warning>
  </Step>

  <Step title="Override visibility per tool">
    Set `visibility` directly on the `PluginTool` when one tool needs a different tier from the rest of the plugin.

    ```ts
    import { tool, z, type PluginTool } from '@ixo/oracle-runtime';

    const currentTool: PluginTool = tool(handler, {
      name: 'get_current_weather',
      description: 'Get the current weather for a city.',
      schema: z.object({ city: z.string() }),
    });
    currentTool.visibility = 'always';

    const forecastTool: PluginTool = tool(handler, {
      name: 'get_weather_forecast',
      description: 'Get a daily forecast for a city.',
      schema: z.object({ city: z.string(), days: z.number().optional() }),
    });
    forecastTool.visibility = 'on-demand';

    return [currentTool, forecastTool];
    ```

    For the `PluginTool` shape, see [types.ts](https://github.com/ixoworld/ixo-oracles-boilerplate/blob/main/packages/oracle-runtime/src/plugin-api/types.ts).
  </Step>

  <Step title="Hold back rare tools in an always plugin (Workers runtime)">
    On `@ixo/oracle-runtime-workers` 0.39.0 and later, an `always` plugin can list tools in [`manifest.onDemandTools`](/build-an-oracle/reference/manifest-schema#ondemandtools) instead of setting `visibility` on each one. The plugin keeps its Tier-1 entry and its other tools, and the listed tools wait until `load_capability` names the plugin. Names are matched at request time, so this works for tools that come from an MCP server too. Give the plugin a [`brief`](/build-an-oracle/reference/manifest-schema#brief) that says what the held-back tools do, because that is its line in the prompt's on-demand catalogue.

    ```ts
    import type { PluginManifest } from '@ixo/oracle-runtime-workers';

    const manifest: PluginManifest = {
      title: 'Weather',
      summary: 'Current weather + forecast lookups for cities.',
      whenToUse: ['Current weather', 'Forecasts', 'Outfit recommendations'],
      visibility: 'always',
      brief: 'week-long forecasts',
      onDemandTools: ['get_weather_forecast'],
    };
    ```

    A tool's own `visibility` still wins over the list. Bound tool definitions are paid on every model call, so this keeps the first call small without hiding the plugin.
  </Step>

  <Step title="Pick the right tier">
    Use this decision tree.

    ```mermaid
    graph TD
        A["Does this plugin expose<br/>agent-callable tools?"]
        A -->|No — middleware / transport only| Silent[silent]
        A -->|Yes| B["Should the agent use it<br/>on most turns?"]
        B -->|Yes| Always[always]
        B -->|No — discover on demand| OnDemand[on-demand]
    ```

    Promoting to `'always'` costs ~80 tokens per plugin in the Tier-1 prompt plus the tool schemas on every turn. `'silent'` only stops advertising the plugin to the agent. It does not hide or disable any tools the plugin returns.
  </Step>
</Steps>

## What to know before shipping

- Default is `'on-demand'`. A plugin without an explicit `manifest.visibility` is treated as on-demand.
- `'on-demand'` plugins live in a per-thread `loadedPlugins` set. On the Node.js runtime the set is monotonic: loading is forever for that thread, and a new thread resets it. On the Workers runtime (0.39.0 and later) a cold turn unloads plugins the thread stopped using, and never a warm one, so the prompt cache is kept. See [Loading and unloading on the Workers runtime](/build-an-oracle/understand/meta-tools-and-loading#loading-and-unloading-on-the-workers-runtime).
- Per-tool overrides let you ship a mixed plugin (one `'always'` tool + several `'on-demand'` tools) without splitting it. On the Workers runtime, `manifest.onDemandTools` does the same from the manifest.
- On the Workers runtime (0.39.0 and later) the model reaches an `'on-demand'` plugin from its line in the on-demand catalogue, the [capability router](/build-an-oracle/understand/meta-tools-and-loading#the-capability-router-workers-runtime) can load it before the first model call, and a call to one of its hidden tools loads it. Set `routable: false` to keep the router from preloading it.
- The bundled `sandbox` and `vfs` plugins are wholly `'on-demand'` on the Workers runtime from 0.39.0, and `memory`, `skills` and `user-preferences` hold back their rare tools with `onDemandTools`. Undo any of it with [`manifestOverrides`](/build-an-oracle/develop/enable-bundled-plugins#retune-a-bundled-plugins-manifest), for example `sandbox: { visibility: 'always' }` or `memory: { onDemandTools: [] }`.
- `'silent'` plugins still run their middleware and Nest modules, and any tools they return stay callable by the agent. They are never advertised. Use it for instrumentation, rate limiting, billing, and transports. It is not a way to hide a capability for security.
- A fork with 50 `'on-demand'` plugins can usually keep 3 to 5 loaded per thread, so the budget stays bounded as the catalog grows.

## Where to read next

<CardGroup cols={2}>
  <Card title="Visibility tiers concept" icon="eye" href="/build-an-oracle/understand/visibility-tiers">
    Costs and trade-offs for each tier.
  </Card>
  <Card title="Meta-tools" icon="magnifying-glass" href="/build-an-oracle/understand/meta-tools-and-loading">
    How `list_capabilities` and `load_capability` work.
  </Card>
</CardGroup>
