From 8cb026bf12a62bcb02735909d5b7f65664310fb1 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 5 Mar 2026 19:16:11 +0000 Subject: [PATCH] Add agent_id to ToolTable in all schema files and generate migration - Update schema.prisma (root) with agent_id field on LiteLLM_ToolTable - Update litellm-proxy-extras schema.prisma with agent_id field - Generate migration via ci_cd/run_migration.py: adds agent_id column Co-authored-by: Krish Dholakia --- .../20260305191532_add_agent_id_to_tool_table/migration.sql | 6 ++++++ litellm-proxy-extras/litellm_proxy_extras/schema.prisma | 1 + schema.prisma | 1 + 3 files changed, 8 insertions(+) create mode 100644 litellm-proxy-extras/litellm_proxy_extras/migrations/20260305191532_add_agent_id_to_tool_table/migration.sql diff --git a/litellm-proxy-extras/litellm_proxy_extras/migrations/20260305191532_add_agent_id_to_tool_table/migration.sql b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260305191532_add_agent_id_to_tool_table/migration.sql new file mode 100644 index 00000000000..3215bf9ca63 --- /dev/null +++ b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260305191532_add_agent_id_to_tool_table/migration.sql @@ -0,0 +1,6 @@ +-- AlterTable +ALTER TABLE "LiteLLM_MCPServerTable" ADD COLUMN "spec_path" TEXT; + +-- AlterTable +ALTER TABLE "LiteLLM_ToolTable" ADD COLUMN "agent_id" TEXT; + diff --git a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma index 6d20a71f039..bf562894182 100644 --- a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma +++ b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma @@ -1090,6 +1090,7 @@ model LiteLLM_ToolTable { team_id String? // team that first called this tool key_alias String? // human-readable alias of the virtual key user_agent String? // user-agent of the first request that discovered this tool + agent_id String? // agent that first triggered this tool call last_used_at DateTime? // timestamp of the most recent call created_at DateTime @default(now()) created_by String? diff --git a/schema.prisma b/schema.prisma index f7c07112417..816808ef46e 100644 --- a/schema.prisma +++ b/schema.prisma @@ -1090,6 +1090,7 @@ model LiteLLM_ToolTable { team_id String? // team that first called this tool key_alias String? // human-readable alias of the virtual key user_agent String? // user-agent of the first request that discovered this tool + agent_id String? // agent that first triggered this tool call last_used_at DateTime? // timestamp of the most recent call created_at DateTime @default(now()) created_by String?