Set Active Session
set_active_sessionSet the active notebook session to bind a session ID and server URL, so later tool calls can omit both parameters.
Instructions
Set the active notebook session for subsequent tool calls.
Binds a session_id (and optionally its server_url) so later calls can omit
both session_id and server_url. The binding is written to two places:
this call's MCP-session state (visible to a client that keeps one MCP
session across calls — an mcp-SDK-based client does) and a
process-global fallback consulted only when the MCP-session state has
nothing bound. Over stdio one process serves exactly one client, so the
fallback carries the binding to every later call, fastmcp's own Client
(a fresh MCP session per request on the pinned fastmcp 4.0.3) included.
Over HTTP/SSE one process serves many clients, so the fallback is served
only while the process has seen a single client session; once a second
distinct client session appears, argument-less calls are refused with
reason: binding_ambiguous rather than risk handing one client another
client's notebook — pass both arguments explicitly there. Use
list_active_notebooks first to discover available sessions and their IDs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server_url | No | Optional server URL to bind with the session. | |
| session_id | Yes | The session ID to set as active. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||