<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>FoundryClient | FoundryVTT MCP Server Documentation - v0.2.0</title><meta name="description" content="Documentation for FoundryVTT MCP Server Documentation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">FoundryVTT MCP Server Documentation - v0.2.0</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/foundry_client.html">foundry/client</a></li><li><a href="" aria-current="page">FoundryClient</a></li></ul><h1>Class FoundryClient</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Client for communicating with FoundryVTT instances</p>
<p>This class provides methods for interacting with FoundryVTT through both REST API
and WebSocket connections. It supports dice rolling, actor/item searching,
scene management, and real-time updates.</p>
<p>FoundryClient</p>
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example">Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">client</span><span class="hl-1"> = </span><span class="hl-9">new</span><span class="hl-1"> </span><span class="hl-0">FoundryClient</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">baseUrl:</span><span class="hl-1"> </span><span class="hl-2">'http://localhost:30000'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">useRestModule:</span><span class="hl-1"> </span><span class="hl-9">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">apiKey:</span><span class="hl-1"> </span><span class="hl-2">'your-api-key'</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">connect</span><span class="hl-1">();</span><br/><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">actors</span><span class="hl-1"> = </span><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">searchActors</span><span class="hl-1">({ </span><span class="hl-4">query:</span><span class="hl-1"> </span><span class="hl-2">'Hero'</span><span class="hl-1"> });</span><br/><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">diceResult</span><span class="hl-1"> = </span><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">rollDice</span><span class="hl-1">(</span><span class="hl-2">'1d20+5'</span><span class="hl-1">, </span><span class="hl-2">'Attack roll'</span><span class="hl-1">);</span>
</code><button type="button">Copy</button></pre>
</div></div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L119">src/foundry/client.ts:119</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="#testconnection" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>test<wbr/>Connection</span></a>
<a href="#disconnect" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>disconnect</span></a>
<a href="#connect" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connect</span></a>
<a href="#sendmessage" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>send<wbr/>Message</span></a>
<a href="#onmessage" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Message</span></a>
<a href="#rolldice" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>roll<wbr/>Dice</span></a>
<a href="#searchactors" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>search<wbr/>Actors</span></a>
<a href="#getactor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Actor</span></a>
<a href="#searchitems" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>search<wbr/>Items</span></a>
<a href="#getcurrentscene" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Current<wbr/>Scene</span></a>
<a href="#getscene" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Scene</span></a>
<a href="#getworldinfo" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>World<wbr/>Info</span></a>
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Constructors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="constructor"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="constructorfoundryclient"><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">FoundryClient</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">config</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/foundry_client.FoundryClientConfig.html" class="tsd-signature-type tsd-kind-interface">FoundryClientConfig</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">FoundryClient</a><a href="#constructorfoundryclient" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a new FoundryClient instance</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">config</span>: <a href="../interfaces/foundry_client.FoundryClientConfig.html" class="tsd-signature-type tsd-kind-interface">FoundryClientConfig</a></span><div class="tsd-comment tsd-typography"><p>Configuration object for the client</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">FoundryClient</a></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-1">Example<a href="#example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">client</span><span class="hl-1"> = </span><span class="hl-9">new</span><span class="hl-1"> </span><span class="hl-0">FoundryClient</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">baseUrl:</span><span class="hl-1"> </span><span class="hl-2">'http://localhost:30000'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">useRestModule:</span><span class="hl-1"> </span><span class="hl-9">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">timeout:</span><span class="hl-1"> </span><span class="hl-7">15000</span><br/><span class="hl-1">});</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L140">src/foundry/client.ts:140</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Methods</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="testconnection"><span>test<wbr/>Connection</span><a href="#testconnection" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="testconnection-1"><span class="tsd-kind-call-signature">testConnection</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span><a href="#testconnection-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Tests the connection to FoundryVTT server</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves to true if connection is successful</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws">Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If connection fails</p>
</div><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-2">Example<a href="#example-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-8">try</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">isConnected</span><span class="hl-1"> = </span><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">testConnection</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">'Connected:'</span><span class="hl-1">, </span><span class="hl-4">isConnected</span><span class="hl-1">);</span><br/><span class="hl-1">} </span><span class="hl-8">catch</span><span class="hl-1"> (</span><span class="hl-4">error</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">error</span><span class="hl-1">(</span><span class="hl-2">'Connection failed:'</span><span class="hl-1">, </span><span class="hl-4">error</span><span class="hl-1">);</span><br/><span class="hl-1">}</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L216">src/foundry/client.ts:216</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="disconnect"><span>disconnect</span><a href="#disconnect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="disconnect-1"><span class="tsd-kind-call-signature">disconnect</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#disconnect-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Disconnects from FoundryVTT server</p>
<p>Closes WebSocket connection and resets connection state.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when disconnection is complete</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-3">Example<a href="#example-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">disconnect</span><span class="hl-1">();</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">'Disconnected from FoundryVTT'</span><span class="hl-1">);</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L272">src/foundry/client.ts:272</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="connect"><span>connect</span><a href="#connect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="connect-1"><span class="tsd-kind-call-signature">connect</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#connect-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Establishes connection to FoundryVTT server</p>
<p>Uses either REST API or WebSocket connection based on configuration.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when connection is established</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-1">Throws<a href="#throws-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If connection fails</p>
</div><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-4">Example<a href="#example-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">connect</span><span class="hl-1">();</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">'Connected to FoundryVTT'</span><span class="hl-1">);</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L309">src/foundry/client.ts:309</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="sendmessage"><span>send<wbr/>Message</span><a href="#sendmessage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="sendmessage-1"><span class="tsd-kind-call-signature">sendMessage</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">message</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#sendmessage-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sends a message via WebSocket connection</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">message</span>: <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>Message object to send</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-5">Example<a href="#example-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">sendMessage</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-2">'chat'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">content:</span><span class="hl-1"> </span><span class="hl-2">'Hello from MCP!'</span><br/><span class="hl-1">});</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L338">src/foundry/client.ts:338</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="onmessage"><span>on<wbr/>Message</span><a href="#onmessage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="onmessage-1"><span class="tsd-kind-call-signature">onMessage</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">type</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">handler</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#onmessage-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Registers a message handler for specific WebSocket message types</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">type</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Message type to handle</p>
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">handler</span>: <span class="tsd-signature-type">Function</span></span><div class="tsd-comment tsd-typography"><p>Function to call when message is received</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-6">Example<a href="#example-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">onMessage</span><span class="hl-1">(</span><span class="hl-2">'combatUpdate'</span><span class="hl-1">, (</span><span class="hl-4">data</span><span class="hl-1">) </span><span class="hl-9">=></span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">'Combat updated:'</span><span class="hl-1">, </span><span class="hl-4">data</span><span class="hl-1">);</span><br/><span class="hl-1">});</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L358">src/foundry/client.ts:358</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="rolldice"><span>roll<wbr/>Dice</span><a href="#rolldice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="rolldice-1"><span class="tsd-kind-call-signature">rollDice</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">formula</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">reason</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/foundry_types.DiceRoll.html" class="tsd-signature-type tsd-kind-interface">DiceRoll</a><span class="tsd-signature-symbol">></span><a href="#rolldice-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Rolls dice using FoundryVTT's dice system</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">formula</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Dice formula in standard notation (e.g., '1d20+5', '3d6')</p>
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">reason</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Optional reason for the roll</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/foundry_types.DiceRoll.html" class="tsd-signature-type tsd-kind-interface">DiceRoll</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to dice roll result</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-7">Example<a href="#example-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">result</span><span class="hl-1"> = </span><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">rollDice</span><span class="hl-1">(</span><span class="hl-2">'1d20+5'</span><span class="hl-1">, </span><span class="hl-2">'Attack roll'</span><span class="hl-1">);</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`Rolled </span><span class="hl-9">${</span><span class="hl-4">result</span><span class="hl-10">.</span><span class="hl-4">total</span><span class="hl-9">}</span><span class="hl-2"> (</span><span class="hl-9">${</span><span class="hl-4">result</span><span class="hl-10">.</span><span class="hl-4">breakdown</span><span class="hl-9">}</span><span class="hl-2">)`</span><span class="hl-1">);</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L406">src/foundry/client.ts:406</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="searchactors"><span>search<wbr/>Actors</span><a href="#searchactors" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="searchactors-1"><span class="tsd-kind-call-signature">searchActors</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">params</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/foundry_client.SearchActorsParams.html" class="tsd-signature-type tsd-kind-interface">SearchActorsParams</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ActorSearchResult</span><span class="tsd-signature-symbol">></span><a href="#searchactors-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Searches for actors in FoundryVTT</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">params</span>: <a href="../interfaces/foundry_client.SearchActorsParams.html" class="tsd-signature-type tsd-kind-interface">SearchActorsParams</a></span><div class="tsd-comment tsd-typography"><p>Search parameters</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ActorSearchResult</span><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to search results</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-8">Example<a href="#example-8" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">results</span><span class="hl-1"> = </span><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">searchActors</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">query:</span><span class="hl-1"> </span><span class="hl-2">'Gandalf'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-2">'npc'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">limit:</span><span class="hl-1"> </span><span class="hl-7">10</span><br/><span class="hl-1">});</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`Found </span><span class="hl-9">${</span><span class="hl-4">results</span><span class="hl-10">.</span><span class="hl-4">actors</span><span class="hl-10">.</span><span class="hl-4">length</span><span class="hl-9">}</span><span class="hl-2"> actors`</span><span class="hl-1">);</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L490">src/foundry/client.ts:490</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getactor"><span>get<wbr/>Actor</span><a href="#getactor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getactor-1"><span class="tsd-kind-call-signature">getActor</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">actorId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/foundry_types.FoundryActor.html" class="tsd-signature-type tsd-kind-interface">FoundryActor</a><span class="tsd-signature-symbol">></span><a href="#getactor-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves detailed information about a specific actor</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">actorId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The ID of the actor to retrieve</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/foundry_types.FoundryActor.html" class="tsd-signature-type tsd-kind-interface">FoundryActor</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to actor data</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-2">Throws<a href="#throws-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If actor is not found</p>
</div><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-9">Example<a href="#example-9" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">actor</span><span class="hl-1"> = </span><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">getActor</span><span class="hl-1">(</span><span class="hl-2">'actor-id-123'</span><span class="hl-1">);</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`Actor: </span><span class="hl-9">${</span><span class="hl-4">actor</span><span class="hl-10">.</span><span class="hl-4">name</span><span class="hl-9">}</span><span class="hl-2"> (</span><span class="hl-9">${</span><span class="hl-4">actor</span><span class="hl-10">.</span><span class="hl-4">type</span><span class="hl-9">}</span><span class="hl-2">)`</span><span class="hl-1">);</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L525">src/foundry/client.ts:525</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="searchitems"><span>search<wbr/>Items</span><a href="#searchitems" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="searchitems-1"><span class="tsd-kind-call-signature">searchItems</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">params</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/foundry_client.SearchItemsParams.html" class="tsd-signature-type tsd-kind-interface">SearchItemsParams</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ItemSearchResult</span><span class="tsd-signature-symbol">></span><a href="#searchitems-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Searches for items in FoundryVTT</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">params</span>: <a href="../interfaces/foundry_client.SearchItemsParams.html" class="tsd-signature-type tsd-kind-interface">SearchItemsParams</a></span><div class="tsd-comment tsd-typography"><p>Search parameters</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ItemSearchResult</span><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to search results</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-10">Example<a href="#example-10" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">results</span><span class="hl-1"> = </span><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">searchItems</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">query:</span><span class="hl-1"> </span><span class="hl-2">'sword'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-2">'weapon'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">rarity:</span><span class="hl-1"> </span><span class="hl-2">'rare'</span><br/><span class="hl-1">});</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`Found </span><span class="hl-9">${</span><span class="hl-4">results</span><span class="hl-10">.</span><span class="hl-4">items</span><span class="hl-10">.</span><span class="hl-4">length</span><span class="hl-9">}</span><span class="hl-2"> items`</span><span class="hl-1">);</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L554">src/foundry/client.ts:554</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getcurrentscene"><span>get<wbr/>Current<wbr/>Scene</span><a href="#getcurrentscene" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getcurrentscene-1"><span class="tsd-kind-call-signature">getCurrentScene</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">sceneId</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/foundry_types.FoundryScene.html" class="tsd-signature-type tsd-kind-interface">FoundryScene</a><span class="tsd-signature-symbol">></span><a href="#getcurrentscene-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the current active scene or a specific scene by ID</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">sceneId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Optional scene ID. If not provided, returns current scene</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/foundry_types.FoundryScene.html" class="tsd-signature-type tsd-kind-interface">FoundryScene</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to scene data</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-3">Throws<a href="#throws-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If scene is not found</p>
</div><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-11">Example<a href="#example-11" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">currentScene</span><span class="hl-1"> = </span><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">getCurrentScene</span><span class="hl-1">();</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`Current scene: </span><span class="hl-9">${</span><span class="hl-4">currentScene</span><span class="hl-10">.</span><span class="hl-4">name</span><span class="hl-9">}</span><span class="hl-2">`</span><span class="hl-1">);</span><br/><br/><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">specificScene</span><span class="hl-1"> = </span><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">getCurrentScene</span><span class="hl-1">(</span><span class="hl-2">'scene-id-123'</span><span class="hl-1">);</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L585">src/foundry/client.ts:585</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getscene"><span>get<wbr/>Scene</span><a href="#getscene" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getscene-1"><span class="tsd-kind-call-signature">getScene</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">sceneId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/foundry_types.FoundryScene.html" class="tsd-signature-type tsd-kind-interface">FoundryScene</a><span class="tsd-signature-symbol">></span><a href="#getscene-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves a specific scene by ID</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">sceneId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The ID of the scene to retrieve</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/foundry_types.FoundryScene.html" class="tsd-signature-type tsd-kind-interface">FoundryScene</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to scene data</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-12">Example<a href="#example-12" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">scene</span><span class="hl-1"> = </span><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">getScene</span><span class="hl-1">(</span><span class="hl-2">'scene-id-123'</span><span class="hl-1">);</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`Scene: </span><span class="hl-9">${</span><span class="hl-4">scene</span><span class="hl-10">.</span><span class="hl-4">name</span><span class="hl-9">}</span><span class="hl-2"> (</span><span class="hl-9">${</span><span class="hl-4">scene</span><span class="hl-10">.</span><span class="hl-4">width</span><span class="hl-9">}</span><span class="hl-2">x</span><span class="hl-9">${</span><span class="hl-4">scene</span><span class="hl-10">.</span><span class="hl-4">height</span><span class="hl-9">}</span><span class="hl-2">)`</span><span class="hl-1">);</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L625">src/foundry/client.ts:625</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getworldinfo"><span>get<wbr/>World<wbr/>Info</span><a href="#getworldinfo" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getworldinfo-1"><span class="tsd-kind-call-signature">getWorldInfo</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/foundry_types.FoundryWorld.html" class="tsd-signature-type tsd-kind-interface">FoundryWorld</a><span class="tsd-signature-symbol">></span><a href="#getworldinfo-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves information about the current world</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/foundry_types.FoundryWorld.html" class="tsd-signature-type tsd-kind-interface">FoundryWorld</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to world information</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-4">Throws<a href="#throws-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If world information cannot be retrieved</p>
</div><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-13">Example<a href="#example-13" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-9">const</span><span class="hl-1"> </span><span class="hl-5">world</span><span class="hl-1"> = </span><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">getWorldInfo</span><span class="hl-1">();</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`World: </span><span class="hl-9">${</span><span class="hl-4">world</span><span class="hl-10">.</span><span class="hl-4">title</span><span class="hl-9">}</span><span class="hl-2"> (</span><span class="hl-9">${</span><span class="hl-4">world</span><span class="hl-10">.</span><span class="hl-4">system</span><span class="hl-9">}</span><span class="hl-2">)`</span><span class="hl-1">);</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/laurigates/foundryvtt-mcp/blob/cbac663ae79aeeb9bd98ada23823ea04cf41ebb6/src/foundry/client.ts#L640">src/foundry/client.ts:640</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#testconnection"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>test<wbr/>Connection</span></a><a href="#disconnect"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>disconnect</span></a><a href="#connect"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connect</span></a><a href="#sendmessage"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>send<wbr/>Message</span></a><a href="#onmessage"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Message</span></a><a href="#rolldice"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>roll<wbr/>Dice</span></a><a href="#searchactors"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>search<wbr/>Actors</span></a><a href="#getactor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Actor</span></a><a href="#searchitems"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>search<wbr/>Items</span></a><a href="#getcurrentscene"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Current<wbr/>Scene</span></a><a href="#getscene"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Scene</span></a><a href="#getworldinfo"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>World<wbr/>Info</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">FoundryVTT MCP Server Documentation - v0.2.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>