Skip to main content
Glama
caretdev

InterSystems IRIS MCP Server

execute_sql

Run SQL queries directly on the InterSystems IRIS MCP Server to monitor and manipulate data, ensuring efficient interoperability management.

Instructions

Execute an SQL query on the Server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsNo
queryYes

Implementation Reference

  • The main handler function for the 'execute_sql' tool. It executes the provided SQL query on the IRIS database connection, fetches up to 100 rows, and returns the results as text content. Registered via the @server.tool decorator.
    @server.tool(description="Execute an SQL query on the Server") async def execute_sql( query: str, ctx: Context, params: list[str] = [] ) -> list[types.TextContent]: # params = arguments.get("params", []) logger.info(f"Executing SQL query: {query}") conn = ctx.db with conn.cursor() as cursor: cursor.execute(query, params) # limit by 100 rows rows = cursor.fetchall()[:100] return [types.TextContent(type="text", text=str(rows))]

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/caretdev/mcp-server-iris'

If you have feedback or need assistance with the MCP directory API, please join our Discord server