Rulvar API reference / @rulvar/rulvar / McpToolSource
Interface: McpToolSource
Defined in: packages/core/dist/index.d.ts
The ToolSource returned by mcp: the frozen ToolSource seam plus the lifecycle the seam deliberately leaves to the host. close() releases everything the source created on first use: the SDK client, its transport, and, for stdio, the spawned child process, without which a one shot host process cannot exit naturally after a run, because the child and its pipes keep the event loop alive (v1.33.0 review P2). It is idempotent, resolves even when the connection never succeeded, and resets the source, so a later tools() call connects afresh. The engine never closes a source, because one source may serve many runs: the host owns the lifecycle and should close once its runs have settled (closing while a run is in flight fails that run's MCP tool calls).
Extends
Properties
| Property | Type | Inherited from | Defined in |
|---|---|---|---|
id | string | ToolSource.id | packages/core/dist/index.d.ts |
Methods
close()
close(): Promise<void>;Defined in: packages/core/dist/index.d.ts
Returns
Promise<void>
describeRegulatedPosture()?
optional describeRegulatedPosture(): RegulatedPostureDescriptor;Defined in: packages/core/dist/index.d.ts
The construction-side posture attestation (RV4101): a PURE snapshot of the risk postures this source chose at construction (no wire, no connect, no side effects), read by compileRegulatedProfile to refuse a loosened posture and hash a tightened one. Optional: a source without it counts into the profile's unrecognized tally instead of being implied verified.
Returns
Inherited from
ToolSource.describeRegulatedPosture
tools()
tools(session): Promise<ToolDef<SchemaSpec<unknown>>[]>;Defined in: packages/core/dist/index.d.ts
Parameters
| Parameter | Type |
|---|---|
session | ToolSourceSession |
Returns
Promise<ToolDef<SchemaSpec<unknown>>[]>