Class: FluentRouter<TContext>
Defined in: packages/core/src/core/builder/FluentRouter.ts:44
Fluent router that shares prefix, description, and middleware across child tools created via .query(), .mutation(), .action().
Type Parameters
| Type Parameter | Description |
|---|---|
TContext | Base application context |
Constructors
Constructor
new FluentRouter<TContext>(prefix): FluentRouter<TContext>;Defined in: packages/core/src/core/builder/FluentRouter.ts:50
Parameters
| Parameter | Type |
|---|---|
prefix | string |
Returns
FluentRouter<TContext>
Methods
action()
action(action): FluentToolBuilder<TContext>;Defined in: packages/core/src/core/builder/FluentRouter.ts:116
Create a neutral action tool under this router's prefix.
Parameters
| Parameter | Type | Description |
|---|---|---|
action | string | Action name (e.g. 'update' → tool name 'prefix.update') |
Returns
FluentToolBuilder<TContext>
A FluentToolBuilder with the prefixed name and inherited config
describe()
describe(text): this;Defined in: packages/core/src/core/builder/FluentRouter.ts:60
Set the shared description for all tools in this router.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | Human-readable description |
Returns
this
this for chaining
mutation()
mutation(action): FluentToolBuilder<TContext>;Defined in: packages/core/src/core/builder/FluentRouter.ts:106
Create a destructive mutation tool under this router's prefix.
Parameters
| Parameter | Type | Description |
|---|---|---|
action | string | Action name (e.g. 'delete' → tool name 'prefix.delete') |
Returns
FluentToolBuilder<TContext>
A FluentToolBuilder with the prefixed name and inherited config
query()
query(action): FluentToolBuilder<TContext>;Defined in: packages/core/src/core/builder/FluentRouter.ts:96
Create a read-only query tool under this router's prefix.
Parameters
| Parameter | Type | Description |
|---|---|---|
action | string | Action name (e.g. 'list' → tool name 'prefix.list') |
Returns
FluentToolBuilder<TContext>
A FluentToolBuilder with the prefixed name and inherited config
tags()
tags(...tags): this;Defined in: packages/core/src/core/builder/FluentRouter.ts:85
Set capability tags shared by all tools in this router.
Parameters
| Parameter | Type | Description |
|---|---|---|
...tags | string[] | Tag strings for filtering |
Returns
this
this for chaining
use()
use(mw): this;Defined in: packages/core/src/core/builder/FluentRouter.ts:74
Add middleware shared by all tools in this router.
Accepts both MiddlewareDefinition from f.middleware() and raw MiddlewareFn functions.
Parameters
| Parameter | Type | Description |
|---|---|---|
mw | | MiddlewareFn<TContext> | MiddlewareDefinition<TContext, Record<string, unknown>> | Middleware function or MiddlewareDefinition |
Returns
this
this for chaining