<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Advanced template on pgmi</title><link>https://vvka-141.github.io/pgmi/docs/advanced/</link><description>Recent content in Advanced template on pgmi</description><generator>Hugo</generator><language>en</language><atom:link href="https://vvka-141.github.io/pgmi/docs/advanced/index.xml" rel="self" type="application/rss+xml"/><item><title>API keys</title><link>https://vvka-141.github.io/pgmi/docs/api-keys/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://vvka-141.github.io/pgmi/docs/api-keys/</guid><description>&lt;h1 id="advanced-template-api-key-authentication"&gt;Advanced Template: API Key Authentication&lt;a class="anchor" href="#advanced-template-api-key-authentication"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;blockquote class='book-hint '&gt;
&lt;p&gt;&lt;strong&gt;Scope: advanced template only.&lt;/strong&gt; This subsystem is scaffolded by
&lt;code&gt;pgmi init --template advanced&lt;/code&gt; (&lt;code&gt;membership/08-api-keys.sql&lt;/code&gt;). It is not
part of pgmi core and is not included in the basic template.&lt;/p&gt;
&lt;p&gt;These API keys authenticate callers of the APIs &lt;em&gt;generated by the advanced
template&lt;/em&gt;. They are unrelated to PostgreSQL connection credentials or to
any authentication used by the pgmi CLI itself.&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;Machine-to-machine authentication for agents, MCP clients, and CI pipelines calling your deployed application&amp;rsquo;s REST/RPC/MCP endpoints.&lt;/p&gt;</description></item><item><title>MCP gateway overview</title><link>https://vvka-141.github.io/pgmi/docs/mcp/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://vvka-141.github.io/pgmi/docs/mcp/</guid><description>&lt;h1 id="advanced-template-mcp-gateway"&gt;Advanced Template: MCP Gateway&lt;a class="anchor" href="#advanced-template-mcp-gateway"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;blockquote class='book-hint '&gt;
&lt;p&gt;&lt;strong&gt;Scope: advanced template only.&lt;/strong&gt; This subsystem is scaffolded by
&lt;code&gt;pgmi init --template advanced&lt;/code&gt;. It is not part of pgmi core and is not
included in the basic template. The generated SQL and gateway become
application code that you own.&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;pgmi has &lt;strong&gt;two unrelated MCP surfaces&lt;/strong&gt; — be sure you&amp;rsquo;re reading about the right one:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;pgmi serve&lt;/code&gt;&lt;/strong&gt; (part of the CLI, every install): exposes pgmi&amp;rsquo;s project-inspection commands as an MCP server over stdio, so a coding agent can drive pgmi itself. See the &lt;a href="https://vvka-141.github.io/pgmi/docs/cli/"&gt;CLI reference&lt;/a&gt;
.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The advanced-template MCP gateway&lt;/strong&gt; (this section): exposes &lt;em&gt;your deployed PostgreSQL application&lt;/em&gt; — its tools, resources, and prompts — to AI assistants over HTTP.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Model Context Protocol (MCP) is an open standard that allows AI
applications (Claude Desktop, VS Code Copilot, etc.) to connect to external
systems. The advanced template implements MCP entirely in PostgreSQL, with a
thin HTTP gateway for transport.&lt;/p&gt;</description></item><item><title>Run the MCP gateway</title><link>https://vvka-141.github.io/pgmi/docs/advanced/mcp-gateway/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://vvka-141.github.io/pgmi/docs/advanced/mcp-gateway/</guid><description>&lt;h1 id="run-the-mcp-gateway"&gt;Run the MCP Gateway&lt;a class="anchor" href="#run-the-mcp-gateway"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;blockquote class='book-hint '&gt;
&lt;p&gt;&lt;strong&gt;Scope: advanced template only.&lt;/strong&gt; The gateway (&lt;code&gt;tools/mcp-gateway.py&lt;/code&gt;) is
generated by &lt;code&gt;pgmi init --template advanced&lt;/code&gt; and becomes application code
you own. New to this subsystem? Start with the &lt;a href="https://vvka-141.github.io/pgmi/docs/mcp/"&gt;overview&lt;/a&gt;
.&lt;/p&gt;
&lt;/blockquote&gt;&lt;h2 id="quick-start"&gt;Quick Start&lt;a class="anchor" href="#quick-start"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="1-deploy-the-advanced-template"&gt;1. Deploy the Advanced Template&lt;a class="anchor" href="#1-deploy-the-advanced-template"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;pgmi init --template advanced myproject
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd myproject
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;pgmi deploy --connection &lt;span style="color:#e6db74"&gt;&amp;#34;postgresql://user:pass@localhost:5432/mydb&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="2-start-the-http-gateway"&gt;2. Start the HTTP Gateway&lt;a class="anchor" href="#2-start-the-http-gateway"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;pgmi init --template advanced&lt;/code&gt; command generates a &lt;code&gt;tools/&lt;/code&gt; directory with the Python gateway:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd tools
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;pip install -r requirements.txt
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;export DATABASE_URL&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;postgresql://user:pass@localhost:5432/mydb&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python mcp-gateway.py&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Requirements:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Author MCP handlers</title><link>https://vvka-141.github.io/pgmi/docs/advanced/mcp-handlers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://vvka-141.github.io/pgmi/docs/advanced/mcp-handlers/</guid><description>&lt;h1 id="author-mcp-tools-resources-and-prompts"&gt;Author MCP Tools, Resources, and Prompts&lt;a class="anchor" href="#author-mcp-tools-resources-and-prompts"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;blockquote class='book-hint '&gt;
&lt;p&gt;&lt;strong&gt;Scope: advanced template only.&lt;/strong&gt; Handlers are SQL functions in your
project, registered with &lt;code&gt;api.create_or_replace_mcp_handler&lt;/code&gt;. New to this
subsystem? Start with the &lt;a href="https://vvka-141.github.io/pgmi/docs/mcp/"&gt;overview&lt;/a&gt;
.&lt;/p&gt;
&lt;/blockquote&gt;&lt;h2 id="mcp-types"&gt;MCP Types&lt;a class="anchor" href="#mcp-types"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Type&lt;/th&gt;
					&lt;th&gt;Purpose&lt;/th&gt;
					&lt;th&gt;Key Metadata&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Tool&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;Executable actions&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;name&lt;/code&gt;, &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;inputSchema&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Resource&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;Data access via URI&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;name&lt;/code&gt;, &lt;code&gt;uriTemplate&lt;/code&gt;, &lt;code&gt;mimeType&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Prompt&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;Message templates&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;name&lt;/code&gt;, &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;arguments&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="request-and-response-types"&gt;Request and Response Types&lt;a class="anchor" href="#request-and-response-types"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;-- Request type (passed to your handler)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;CREATE&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;TYPE&lt;/span&gt; api.mcp_request &lt;span style="color:#66d9ef"&gt;AS&lt;/span&gt; (
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; arguments jsonb, &lt;span style="color:#75715e"&gt;-- Tool/prompt arguments
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; uri text, &lt;span style="color:#75715e"&gt;-- Resource URI
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; context jsonb, &lt;span style="color:#75715e"&gt;-- Auth: {&amp;#34;user_id&amp;#34;: &amp;#34;...&amp;#34;, &amp;#34;tenant_id&amp;#34;: &amp;#34;...&amp;#34;}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; request_id jsonb &lt;span style="color:#75715e"&gt;-- JSON-RPC id (string, integer, or null); must echo in response
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;);
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;-- Response type (JSON-RPC 2.0 envelope)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;CREATE&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;TYPE&lt;/span&gt; api.mcp_response &lt;span style="color:#66d9ef"&gt;AS&lt;/span&gt; (
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; envelope jsonb &lt;span style="color:#75715e"&gt;-- {jsonrpc, id, result} or {jsonrpc, id, error}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;request_id&lt;/code&gt; is &lt;strong&gt;jsonb&lt;/strong&gt; across the MCP API so JSON-RPC 2.0 id types (string,
integer, null) round-trip verbatim. Passing a raw text literal (&lt;code&gt;'req-1'&lt;/code&gt;)
fails domain parsing — use &lt;code&gt;'&amp;quot;req-1&amp;quot;'::jsonb&lt;/code&gt; or &lt;code&gt;'42'::jsonb&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>MCP SQL API reference</title><link>https://vvka-141.github.io/pgmi/docs/advanced/mcp-sql-api/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://vvka-141.github.io/pgmi/docs/advanced/mcp-sql-api/</guid><description>&lt;h1 id="mcp-sql-api-reference"&gt;MCP SQL API Reference&lt;a class="anchor" href="#mcp-sql-api-reference"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;blockquote class='book-hint '&gt;
&lt;p&gt;&lt;strong&gt;Scope: advanced template only.&lt;/strong&gt; These functions are scaffolded into the
&lt;code&gt;api&lt;/code&gt; schema of your project. New to this subsystem? Start with the
&lt;a href="https://vvka-141.github.io/pgmi/docs/mcp/"&gt;overview&lt;/a&gt;
.&lt;/p&gt;
&lt;/blockquote&gt;&lt;h2 id="core-functions"&gt;Core Functions&lt;a class="anchor" href="#core-functions"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Function&lt;/th&gt;
					&lt;th&gt;Purpose&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;api.mcp_handle_request(request, context)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Unified dispatcher — returns &lt;code&gt;NULL&lt;/code&gt; envelope for JSON-RPC notifications (no response sent)&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;api.mcp_initialize(params, request_id jsonb)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Handshake handler&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;api.mcp_ping(request_id jsonb)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Keepalive response&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;api.mcp_call_tool(name, args, context, id jsonb)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Invoke a tool; handler exceptions → &lt;code&gt;result.isError=true&lt;/code&gt; (not JSON-RPC error)&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;api.mcp_read_resource(uri, context, id jsonb)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Read a resource&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;api.mcp_get_prompt(name, args, context, id jsonb)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Expand a prompt&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;api.mcp_list_tools(p_tags text[] DEFAULT NULL)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Tool discovery; hides &lt;code&gt;requires_auth&lt;/code&gt; tools when &lt;code&gt;auth.user_id&lt;/code&gt; is unset; surfaces tags as &lt;code&gt;_meta.tags&lt;/code&gt;; &lt;code&gt;p_tags&lt;/code&gt; filter matches by overlap (NULL or empty array = no filter)&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;api.mcp_list_resources()&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Concrete-resource discovery (&lt;code&gt;resources/list&lt;/code&gt;); emits &lt;code&gt;uri&lt;/code&gt; objects only; same auth-hide semantics&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;api.mcp_list_resource_templates()&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Template discovery (&lt;code&gt;resources/templates/list&lt;/code&gt;); emits &lt;code&gt;uriTemplate&lt;/code&gt; objects (RFC 6570); same auth-hide semantics&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;api.mcp_list_prompts()&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Prompt discovery; same auth-hide semantics&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;api.mcp_request_policy(request, requested_isolation)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Resolve a request&amp;rsquo;s transaction policy before opening the dispatch transaction — see &lt;a href="https://vvka-141.github.io/pgmi/docs/advanced/mcp-gateway/#transaction-policy"&gt;transaction policy&lt;/a&gt;
&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;code&gt;request_id&lt;/code&gt; is &lt;strong&gt;jsonb&lt;/strong&gt; across the MCP API so JSON-RPC 2.0 id types (string,
integer, null) round-trip verbatim. Passing a raw text literal (&lt;code&gt;'req-1'&lt;/code&gt;)
fails domain parsing — use &lt;code&gt;'&amp;quot;req-1&amp;quot;'::jsonb&lt;/code&gt; or &lt;code&gt;'42'::jsonb&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>MCP protocol compliance &amp; limitations</title><link>https://vvka-141.github.io/pgmi/docs/advanced/mcp-protocol/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://vvka-141.github.io/pgmi/docs/advanced/mcp-protocol/</guid><description>&lt;h1 id="mcp-protocol-compliance-and-limitations"&gt;MCP Protocol Compliance and Limitations&lt;a class="anchor" href="#mcp-protocol-compliance-and-limitations"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;blockquote class='book-hint '&gt;
&lt;p&gt;&lt;strong&gt;Scope: advanced template only.&lt;/strong&gt; This page specifies how the scaffolded
MCP implementation behaves at the protocol level. New to this subsystem?
Start with the &lt;a href="https://vvka-141.github.io/pgmi/docs/mcp/"&gt;overview&lt;/a&gt;
.&lt;/p&gt;
&lt;/blockquote&gt;&lt;h2 id="protocol-versions"&gt;Protocol Versions&lt;a class="anchor" href="#protocol-versions"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;pgmi implements MCP using JSON-RPC 2.0:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Supported protocol versions&lt;/strong&gt;: &lt;code&gt;2024-11-05&lt;/code&gt;, &lt;code&gt;2025-03-26&lt;/code&gt;, &lt;code&gt;2025-06-18&lt;/code&gt;, &lt;code&gt;2025-11-25&lt;/code&gt; (an unknown-newer proposal negotiates down to the server&amp;rsquo;s best supported version)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transport&lt;/strong&gt;: HTTP POST to &lt;code&gt;/mcp&lt;/code&gt; endpoint&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authentication&lt;/strong&gt;: Context parameter (not HTTP headers)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="transport-behavior"&gt;Transport Behavior&lt;a class="anchor" href="#transport-behavior"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The gateway implements the Streamable HTTP transport&amp;rsquo;s request/response path:&lt;/p&gt;</description></item><item><title>Semantic MCP curation</title><link>https://vvka-141.github.io/pgmi/docs/advanced/semantic-mcp-tool-curation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://vvka-141.github.io/pgmi/docs/advanced/semantic-mcp-tool-curation/</guid><description>&lt;h1 id="recipe-semantic-agent-tool-curation"&gt;Recipe: Semantic Agent-Tool Curation&lt;a class="anchor" href="#recipe-semantic-agent-tool-curation"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;blockquote class='book-hint '&gt;
&lt;p&gt;&lt;strong&gt;Scope: optional extension to the advanced-template MCP gateway.&lt;/strong&gt;
Prerequisites: a project scaffolded from the advanced template, its handler
registry, a vector extension/provider decision, and enough MCP tools that
curation is worth the machinery.&lt;/p&gt;
&lt;/blockquote&gt;&lt;blockquote class='book-hint '&gt;
&lt;p&gt;&lt;strong&gt;Use this only at tool-overload scale.&lt;/strong&gt; When an agent has &lt;em&gt;dozens&lt;/em&gt; of tools,
exposing all of them at once dilutes the model&amp;rsquo;s attention and inflates token
cost. This recipe surfaces the relevant subset for a given query. If your
project has a handful of tools, skip it — expose handlers directly through the
existing MCP/RPC routing and let the client list them all.&lt;/p&gt;</description></item><item><title>Transaction policy</title><link>https://vvka-141.github.io/pgmi/docs/advanced/transaction-policy/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://vvka-141.github.io/pgmi/docs/advanced/transaction-policy/</guid><description>&lt;h1 id="per-route-transaction-policy"&gt;Per-route transaction policy&lt;a class="anchor" href="#per-route-transaction-policy"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;A handler declares what it needs — a minimum transaction isolation floor and
whether the route is read-only — and the system resolves, opens, enforces, and
publishes the resulting policy. No external configuration, no runtime
surprises.&lt;/p&gt;
&lt;h2 id="what-a-route-declares"&gt;What a route declares&lt;a class="anchor" href="#what-a-route-declares"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Two metadata keys on any REST, RPC, or MCP handler:&lt;/p&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Key&lt;/th&gt;
					&lt;th&gt;Values&lt;/th&gt;
					&lt;th&gt;Default&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;minTransactionIsolation&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;read committed&lt;/code&gt;, &lt;code&gt;repeatable read&lt;/code&gt;, &lt;code&gt;serializable&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;none (behaves as &lt;code&gt;read committed&lt;/code&gt;)&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;readOnly&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;true&lt;/code&gt; / &lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;false&lt;/code&gt; (read-write)&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Case- and separator-insensitive: &lt;code&gt;READ COMMITTED&lt;/code&gt;, &lt;code&gt;read-committed&lt;/code&gt;, and
&lt;code&gt;Read_Committed&lt;/code&gt; all normalize to &lt;code&gt;read committed&lt;/code&gt;. &lt;code&gt;read uncommitted&lt;/code&gt; folds
onto &lt;code&gt;read committed&lt;/code&gt;, matching PostgreSQL&amp;rsquo;s behavior — it implements no
dirty-read level.&lt;/p&gt;</description></item></channel></rss>