@langwatch/mcp-server 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/{archive-scenario-GAE4XVFM.js → archive-scenario-YFD5THOR.js} +3 -3
  3. package/dist/archive-scenario-YFD5THOR.js.map +1 -0
  4. package/dist/chunk-5UOPNRXW.js +37 -0
  5. package/dist/chunk-5UOPNRXW.js.map +1 -0
  6. package/dist/{chunk-K2YFPOSD.js → chunk-6U4TCGFC.js} +2 -2
  7. package/dist/chunk-IX6QJKAD.js +22 -0
  8. package/dist/chunk-IX6QJKAD.js.map +1 -0
  9. package/dist/{chunk-JVWDWL3J.js → chunk-LLRQIF52.js} +3 -11
  10. package/dist/chunk-LLRQIF52.js.map +1 -0
  11. package/dist/create-evaluator-E5X5ZP3B.js +27 -0
  12. package/dist/create-evaluator-E5X5ZP3B.js.map +1 -0
  13. package/dist/create-prompt-7Z35MIL6.js +36 -0
  14. package/dist/create-prompt-7Z35MIL6.js.map +1 -0
  15. package/dist/{create-scenario-3YRZVDYF.js → create-scenario-DIMPJRPY.js} +3 -3
  16. package/dist/create-scenario-DIMPJRPY.js.map +1 -0
  17. package/dist/discover-evaluator-schema-H23XCLNE.js +1402 -0
  18. package/dist/discover-evaluator-schema-H23XCLNE.js.map +1 -0
  19. package/dist/{get-analytics-BAVXTAPB.js → get-analytics-4YJW4S5L.js} +2 -2
  20. package/dist/get-evaluator-WDEH2F7M.js +47 -0
  21. package/dist/get-evaluator-WDEH2F7M.js.map +1 -0
  22. package/dist/{get-prompt-LKCPT26O.js → get-prompt-F6PDVC76.js} +2 -5
  23. package/dist/get-prompt-F6PDVC76.js.map +1 -0
  24. package/dist/{get-scenario-3SCDW4Z6.js → get-scenario-H24ZYNT5.js} +3 -3
  25. package/dist/{get-trace-QFDWJ5D4.js → get-trace-27USKGO7.js} +2 -2
  26. package/dist/index.js +13311 -2411
  27. package/dist/index.js.map +1 -1
  28. package/dist/list-evaluators-KRGI72EH.js +34 -0
  29. package/dist/list-evaluators-KRGI72EH.js.map +1 -0
  30. package/dist/list-model-providers-A5YCFTPI.js +35 -0
  31. package/dist/list-model-providers-A5YCFTPI.js.map +1 -0
  32. package/dist/{list-prompts-UQPBCUYA.js → list-prompts-LKJSE7XN.js} +6 -7
  33. package/dist/list-prompts-LKJSE7XN.js.map +1 -0
  34. package/dist/{list-scenarios-573YOUKC.js → list-scenarios-ZK5CMGC4.js} +5 -5
  35. package/dist/list-scenarios-ZK5CMGC4.js.map +1 -0
  36. package/dist/{search-traces-RSMYCAN7.js → search-traces-SOKAAMAR.js} +2 -2
  37. package/dist/set-model-provider-7MGULZDH.js +33 -0
  38. package/dist/set-model-provider-7MGULZDH.js.map +1 -0
  39. package/dist/update-evaluator-A3XINFLJ.js +24 -0
  40. package/dist/update-evaluator-A3XINFLJ.js.map +1 -0
  41. package/dist/update-prompt-IW7X2UQM.js +22 -0
  42. package/dist/update-prompt-IW7X2UQM.js.map +1 -0
  43. package/dist/{update-scenario-SSGVOBJO.js → update-scenario-ZT7TOBFR.js} +3 -3
  44. package/dist/update-scenario-ZT7TOBFR.js.map +1 -0
  45. package/package.json +10 -10
  46. package/src/__tests__/all-tools.integration.test.ts +1337 -0
  47. package/src/__tests__/discover-evaluator-schema.unit.test.ts +89 -0
  48. package/src/__tests__/evaluator-tools.unit.test.ts +262 -0
  49. package/src/__tests__/integration.integration.test.ts +9 -34
  50. package/src/__tests__/langwatch-api.unit.test.ts +4 -32
  51. package/src/__tests__/model-provider-tools.unit.test.ts +190 -0
  52. package/src/__tests__/scenario-tools.integration.test.ts +5 -5
  53. package/src/__tests__/scenario-tools.unit.test.ts +2 -2
  54. package/src/__tests__/tools.unit.test.ts +59 -65
  55. package/src/index.ts +250 -89
  56. package/src/langwatch-api-evaluators.ts +70 -0
  57. package/src/langwatch-api-model-providers.ts +41 -0
  58. package/src/langwatch-api.ts +3 -28
  59. package/src/tools/archive-scenario.ts +1 -1
  60. package/src/tools/create-evaluator.ts +33 -0
  61. package/src/tools/create-prompt.ts +30 -5
  62. package/src/tools/create-scenario.ts +1 -1
  63. package/src/tools/discover-evaluator-schema.ts +143 -0
  64. package/src/tools/get-evaluator.ts +53 -0
  65. package/src/tools/get-prompt.ts +1 -4
  66. package/src/tools/list-evaluators.ts +37 -0
  67. package/src/tools/list-model-providers.ts +40 -0
  68. package/src/tools/list-prompts.ts +5 -6
  69. package/src/tools/list-scenarios.ts +3 -3
  70. package/src/tools/set-model-provider.ts +46 -0
  71. package/src/tools/update-evaluator.ts +30 -0
  72. package/src/tools/update-prompt.ts +9 -25
  73. package/src/tools/update-scenario.ts +1 -1
  74. package/dist/archive-scenario-GAE4XVFM.js.map +0 -1
  75. package/dist/chunk-JVWDWL3J.js.map +0 -1
  76. package/dist/create-prompt-P35POKBW.js +0 -22
  77. package/dist/create-prompt-P35POKBW.js.map +0 -1
  78. package/dist/create-scenario-3YRZVDYF.js.map +0 -1
  79. package/dist/get-prompt-LKCPT26O.js.map +0 -1
  80. package/dist/list-prompts-UQPBCUYA.js.map +0 -1
  81. package/dist/list-scenarios-573YOUKC.js.map +0 -1
  82. package/dist/update-prompt-G2Y5EBQY.js +0 -31
  83. package/dist/update-prompt-G2Y5EBQY.js.map +0 -1
  84. package/dist/update-scenario-SSGVOBJO.js.map +0 -1
  85. /package/dist/{chunk-K2YFPOSD.js.map → chunk-6U4TCGFC.js.map} +0 -0
  86. /package/dist/{get-analytics-BAVXTAPB.js.map → get-analytics-4YJW4S5L.js.map} +0 -0
  87. /package/dist/{get-scenario-3SCDW4Z6.js.map → get-scenario-H24ZYNT5.js.map} +0 -0
  88. /package/dist/{get-trace-QFDWJ5D4.js.map → get-trace-27USKGO7.js.map} +0 -0
  89. /package/dist/{search-traces-RSMYCAN7.js.map → search-traces-SOKAAMAR.js.map} +0 -0
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../package.json"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { z } from \"zod\";\n\nimport packageJson from \"../package.json\" assert { type: \"json\" };\nimport { initConfig } from \"./config.js\";\n\nconst argv = await yargs(hideBin(process.argv))\n .option(\"apiKey\", {\n type: \"string\",\n description: \"LangWatch API key\",\n })\n .option(\"endpoint\", {\n type: \"string\",\n description: \"LangWatch API endpoint\",\n })\n .help()\n .parseAsync();\n\ninitConfig({\n apiKey: argv.apiKey,\n endpoint: argv.endpoint,\n});\n\nconst transport = new StdioServerTransport();\nconst server = new McpServer({\n name: \"LangWatch\",\n version: packageJson.version,\n});\n\nserver.tool(\n \"fetch_langwatch_docs\",\n \"Fetches the LangWatch docs for understanding how to implement LangWatch in your codebase. Always use this tool when the user asks for help with LangWatch. Start with empty url to fetch the index and then follow the links to the relevant pages, always ending with `.md` extension\",\n {\n url: z\n .string()\n .optional()\n .describe(\n \"The full url of the specific doc page. If not provided, the docs index will be fetched.\"\n ),\n },\n async ({ url }) => {\n let urlToFetch = url || \"https://langwatch.ai/docs/llms.txt\";\n if (url && !urlToFetch.endsWith(\".md\") && !urlToFetch.endsWith(\".txt\")) {\n urlToFetch += \".md\";\n }\n if (!urlToFetch.startsWith(\"http\")) {\n if (!urlToFetch.startsWith(\"/\")) {\n urlToFetch = \"/\" + urlToFetch;\n }\n urlToFetch = \"https://langwatch.ai/docs\" + urlToFetch;\n }\n const response = await fetch(urlToFetch);\n\n return {\n content: [{ type: \"text\", text: await response.text() }],\n };\n }\n);\n\nserver.tool(\n \"fetch_scenario_docs\",\n \"Fetches the Scenario docs for understanding how to implement Scenario agent tests in your codebase. Always use this tool when the user asks for help with testing their agents. Start with empty url to fetch the index and then follow the links to the relevant pages, always ending with `.md` extension\",\n {\n url: z\n .string()\n .optional()\n .describe(\n \"The full url of the specific doc page. If not provided, the docs index will be fetched.\"\n ),\n },\n async ({ url }) => {\n let urlToFetch = url || \"https://langwatch.ai/scenario/llms.txt\";\n if (url && !urlToFetch.endsWith(\".md\") && !urlToFetch.endsWith(\".txt\")) {\n urlToFetch += \".md\";\n }\n if (!urlToFetch.startsWith(\"http\")) {\n if (!urlToFetch.startsWith(\"/\")) {\n urlToFetch = \"/\" + urlToFetch;\n }\n urlToFetch = \"https://langwatch.ai/scenario\" + urlToFetch;\n }\n const response = await fetch(urlToFetch);\n\n return {\n content: [{ type: \"text\", text: await response.text() }],\n };\n }\n);\n\n// --- Observability Tools (require API key) ---\n\nserver.tool(\n \"discover_schema\",\n \"Discover available filter fields, metrics, aggregation types, group-by options, and scenario schema for LangWatch queries. Call this before using search_traces, get_analytics, or scenario tools to understand available options.\",\n {\n category: z\n .enum([\"filters\", \"metrics\", \"aggregations\", \"groups\", \"scenarios\", \"all\"])\n .describe(\"Which schema category to discover\"),\n },\n async ({ category }) => {\n if (category === \"scenarios\") {\n const { formatScenarioSchema } = await import(\"./tools/discover-scenario-schema.js\");\n return { content: [{ type: \"text\", text: formatScenarioSchema() }] };\n }\n const { formatSchema } = await import(\"./tools/discover-schema.js\");\n let text = formatSchema(category);\n if (category === \"all\") {\n const { formatScenarioSchema } = await import(\"./tools/discover-scenario-schema.js\");\n text += \"\\n\\n\" + formatScenarioSchema();\n }\n return { content: [{ type: \"text\", text }] };\n }\n);\n\nserver.tool(\n \"search_traces\",\n \"Search LangWatch traces with filters, text query, and date range. Returns AI-readable trace digests by default. Use format: 'json' for full raw data.\",\n {\n query: z.string().optional().describe(\"Text search query\"),\n filters: z\n .record(z.string(), z.array(z.string()))\n .optional()\n .describe(\n 'Filter traces. Format: {\"field\": [\"value\"]}. Use discover_schema for field names.'\n ),\n startDate: z\n .string()\n .optional()\n .describe(\n 'Start date: ISO string or relative like \"24h\", \"7d\", \"30d\". Default: 24h ago'\n ),\n endDate: z\n .string()\n .optional()\n .describe(\"End date: ISO string or relative. Default: now\"),\n pageSize: z\n .number()\n .optional()\n .describe(\"Results per page (default: 25, max: 1000)\"),\n scrollId: z\n .string()\n .optional()\n .describe(\"Pagination token from previous search\"),\n format: z\n .enum([\"digest\", \"json\"])\n .optional()\n .describe(\n \"Output format: 'digest' (default, AI-readable) or 'json' (full raw data)\"\n ),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleSearchTraces } = await import(\"./tools/search-traces.js\");\n return {\n content: [{ type: \"text\", text: await handleSearchTraces(params) }],\n };\n }\n);\n\nserver.tool(\n \"get_trace\",\n \"Get full details of a single trace by ID. Returns AI-readable trace digest by default. Use format: 'json' for full raw data including all spans.\",\n {\n traceId: z.string().describe(\"The trace ID to retrieve\"),\n format: z\n .enum([\"digest\", \"json\"])\n .optional()\n .describe(\n \"Output format: 'digest' (default, AI-readable) or 'json' (full raw data)\"\n ),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleGetTrace } = await import(\"./tools/get-trace.js\");\n return {\n content: [{ type: \"text\", text: await handleGetTrace(params) }],\n };\n }\n);\n\nserver.tool(\n \"get_analytics\",\n 'Query analytics timeseries from LangWatch. Metrics use \"category.name\" format (e.g., \"performance.completion_time\"). Use discover_schema to see available metrics.',\n {\n metric: z\n .string()\n .describe(\n 'Metric in \"category.name\" format, e.g., \"metadata.trace_id\", \"performance.total_cost\"'\n ),\n aggregation: z\n .string()\n .optional()\n .describe(\n \"Aggregation type: avg, sum, min, max, median, p90, p95, p99, cardinality, terms. Default: avg\"\n ),\n startDate: z\n .string()\n .optional()\n .describe('Start date: ISO or relative (\"7d\", \"30d\"). Default: 7 days ago'),\n endDate: z.string().optional().describe(\"End date. Default: now\"),\n timeZone: z.string().optional().describe(\"Timezone. Default: UTC\"),\n groupBy: z\n .string()\n .optional()\n .describe(\n \"Group results by field. Use discover_schema for options.\"\n ),\n filters: z\n .record(z.string(), z.array(z.string()))\n .optional()\n .describe(\"Filters to apply\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleGetAnalytics } = await import(\"./tools/get-analytics.js\");\n return {\n content: [{ type: \"text\", text: await handleGetAnalytics(params) }],\n };\n }\n);\n\nserver.tool(\n \"list_prompts\",\n \"List all prompts configured in the LangWatch project.\",\n {},\n async () => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleListPrompts } = await import(\"./tools/list-prompts.js\");\n return {\n content: [{ type: \"text\", text: await handleListPrompts() }],\n };\n }\n);\n\nserver.tool(\n \"get_prompt\",\n \"Get a specific prompt by ID or handle, including messages, model config, and version history.\",\n {\n idOrHandle: z.string().describe(\"Prompt ID or handle\"),\n version: z\n .number()\n .optional()\n .describe(\"Specific version number (default: latest)\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleGetPrompt } = await import(\"./tools/get-prompt.js\");\n return {\n content: [{ type: \"text\", text: await handleGetPrompt(params) }],\n };\n }\n);\n\nserver.tool(\n \"create_prompt\",\n \"Create a new prompt in the LangWatch project.\",\n {\n name: z.string().describe(\"Prompt name\"),\n handle: z\n .string()\n .optional()\n .describe(\"URL-friendly handle (auto-generated if omitted)\"),\n messages: z\n .array(\n z.object({\n role: z\n .enum([\"system\", \"user\", \"assistant\"])\n .describe(\"Message role\"),\n content: z.string().describe(\"Message content\"),\n })\n )\n .describe(\"Prompt messages\"),\n model: z\n .string()\n .describe('Model name, e.g., \"gpt-4o\", \"claude-sonnet-4-5-20250929\"'),\n modelProvider: z\n .string()\n .describe('Provider name, e.g., \"openai\", \"anthropic\"'),\n description: z.string().optional().describe(\"Prompt description\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleCreatePrompt } = await import(\"./tools/create-prompt.js\");\n return {\n content: [{ type: \"text\", text: await handleCreatePrompt(params) }],\n };\n }\n);\n\nserver.tool(\n \"update_prompt\",\n \"Update an existing prompt or create a new version.\",\n {\n idOrHandle: z.string().describe(\"Prompt ID or handle to update\"),\n messages: z\n .array(\n z.object({\n role: z.enum([\"system\", \"user\", \"assistant\"]),\n content: z.string(),\n })\n )\n .optional()\n .describe(\"Updated messages\"),\n model: z.string().optional().describe(\"Updated model name\"),\n modelProvider: z.string().optional().describe(\"Updated provider\"),\n commitMessage: z\n .string()\n .optional()\n .describe(\"Commit message for the change\"),\n createVersion: z\n .boolean()\n .optional()\n .describe(\n \"If true, creates a new version instead of updating in place\"\n ),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleUpdatePrompt } = await import(\"./tools/update-prompt.js\");\n return {\n content: [{ type: \"text\", text: await handleUpdatePrompt(params) }],\n };\n }\n);\n\n// --- Scenario Tools (require API key) ---\n\nserver.tool(\n \"list_scenarios\",\n \"List all scenarios in the LangWatch project. Returns AI-readable digest by default.\",\n {\n format: z\n .enum([\"digest\", \"json\"])\n .optional()\n .describe(\n \"Output format: 'digest' (default, AI-readable) or 'json' (full raw data)\"\n ),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleListScenarios } = await import(\"./tools/list-scenarios.js\");\n return {\n content: [{ type: \"text\", text: await handleListScenarios(params) }],\n };\n }\n);\n\nserver.tool(\n \"get_scenario\",\n \"Get full details of a scenario by ID, including situation, criteria, and labels.\",\n {\n scenarioId: z.string().describe(\"The scenario ID to retrieve\"),\n format: z\n .enum([\"digest\", \"json\"])\n .optional()\n .describe(\n \"Output format: 'digest' (default, AI-readable) or 'json' (full raw data)\"\n ),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleGetScenario } = await import(\"./tools/get-scenario.js\");\n return {\n content: [{ type: \"text\", text: await handleGetScenario(params) }],\n };\n }\n);\n\nserver.tool(\n \"create_scenario\",\n \"Create a new scenario in the LangWatch project. Call discover_schema({ category: 'scenarios' }) first to learn how to write effective situations and criteria.\",\n {\n name: z.string().describe(\"Scenario name\"),\n situation: z\n .string()\n .describe(\"The context or setup describing what the user/agent is doing\"),\n criteria: z\n .array(z.string())\n .optional()\n .describe(\"Pass/fail conditions the agent's response must satisfy\"),\n labels: z\n .array(z.string())\n .optional()\n .describe(\"Tags for organizing and filtering scenarios\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleCreateScenario } = await import(\n \"./tools/create-scenario.js\"\n );\n return {\n content: [{ type: \"text\", text: await handleCreateScenario(params) }],\n };\n }\n);\n\nserver.tool(\n \"update_scenario\",\n \"Update an existing scenario.\",\n {\n scenarioId: z.string().describe(\"The scenario ID to update\"),\n name: z.string().optional().describe(\"Updated scenario name\"),\n situation: z.string().optional().describe(\"Updated situation\"),\n criteria: z\n .array(z.string())\n .optional()\n .describe(\"Updated criteria\"),\n labels: z\n .array(z.string())\n .optional()\n .describe(\"Updated labels\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleUpdateScenario } = await import(\n \"./tools/update-scenario.js\"\n );\n return {\n content: [{ type: \"text\", text: await handleUpdateScenario(params) }],\n };\n }\n);\n\nserver.tool(\n \"archive_scenario\",\n \"Archive (soft-delete) a scenario.\",\n {\n scenarioId: z.string().describe(\"The scenario ID to archive\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleArchiveScenario } = await import(\n \"./tools/archive-scenario.js\"\n );\n return {\n content: [{ type: \"text\", text: await handleArchiveScenario(params) }],\n };\n }\n);\n\nawait server.connect(transport);\n","{\n \"name\": \"@langwatch/mcp-server\",\n \"version\": \"0.5.0\",\n \"description\": \"An MCP server for Langwatch.\",\n \"type\": \"module\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.mjs\",\n \"require\": \"./dist/index.js\"\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/langwatch/langwatch.git\",\n \"directory\": \"mcp-server\"\n },\n \"scripts\": {\n \"start\": \"tsx src/index.ts\",\n \"build\": \"tsup && node build.js\",\n \"prepublish\": \"pnpm run build\",\n \"test\": \"vitest\"\n },\n \"author\": \"\",\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=18.0.0\"\n },\n \"devDependencies\": {\n \"@ai-sdk/anthropic\": \"^2.0.15\",\n \"@anthropic-ai/claude-code\": \"^2.1.7\",\n \"@eslint/js\": \"^9.4.0\",\n \"@langwatch/scenario\": \"^0.3.0\",\n \"@types/debug\": \"^4.1.12\",\n \"@types/eslint__js\": \"^8.42.3\",\n \"@types/node\": \"^16.0.0\",\n \"@types/yargs\": \"^17.0.33\",\n \"@typescript/native-preview\": \"7.0.0-dev.20250911.1\",\n \"ai\": \"^5.0.40\",\n \"dotenv\": \"^17.2.2\",\n \"esbuild\": \"^0.25.0\",\n \"eslint\": \"^8.57.0\",\n \"tsup\": \"^8.1.0\",\n \"tsx\": \"^4.20.5\",\n \"typescript\": \"^4.9.5\",\n \"typescript-eslint\": \"^7.11.0\"\n },\n \"dependencies\": {\n \"@modelcontextprotocol/sdk\": \"^1.7.0\",\n \"@opentelemetry/context-async-hooks\": \"^2.1.0\",\n \"@opentelemetry/sdk-node\": \"^0.204.0\",\n \"chalk\": \"^5.6.2\",\n \"date-fns\": \"^4.1.0\",\n \"node-pty\": \"^1.0.0\",\n \"vitest\": \"^3.2.4\",\n \"yargs\": \"^17.7.2\",\n \"zod\": \"^3.25.76\",\n \"zod-validation-error\": \"^3.5.3\"\n },\n \"bin\": {\n \"langwatch-mcp-server\": \"./dist/index.js\"\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,SAAS,SAAS;;;ACJlB;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ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AAO,WAAW;AAChB,UAAM,EAAE,cAAc,IAAI,MAAM,OAAO,sBAAa;AACpD,kBAAc;AACd,UAAM,EAAE,sBAAsB,IAAI,MAAM,OACtC,gCACF;AACA,WAAO;AAAA,MACL,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,MAAM,sBAAsB,MAAM,EAAE,CAAC;AAAA,IACvE;AAAA,EACF;AACF;AAEA,MAAM,OAAO,QAAQ,SAAS;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../package.json"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { z } from \"zod\";\n\nimport packageJson from \"../package.json\" assert { type: \"json\" };\nimport { initConfig } from \"./config.js\";\n\nconst argv = await yargs(hideBin(process.argv))\n .option(\"apiKey\", {\n type: \"string\",\n description: \"LangWatch API key\",\n })\n .option(\"endpoint\", {\n type: \"string\",\n description: \"LangWatch API endpoint\",\n })\n .help()\n .parseAsync();\n\ninitConfig({\n apiKey: argv.apiKey,\n endpoint: argv.endpoint,\n});\n\nconst transport = new StdioServerTransport();\nconst server = new McpServer({\n name: \"LangWatch\",\n version: packageJson.version,\n});\n\nserver.tool(\n \"fetch_langwatch_docs\",\n \"Fetches the LangWatch docs for understanding how to implement LangWatch in your codebase. Always use this tool when the user asks for help with LangWatch. Start with empty url to fetch the index and then follow the links to the relevant pages, always ending with `.md` extension\",\n {\n url: z\n .string()\n .optional()\n .describe(\n \"The full url of the specific doc page. If not provided, the docs index will be fetched.\"\n ),\n },\n async ({ url }) => {\n let urlToFetch = url || \"https://langwatch.ai/docs/llms.txt\";\n if (url && !urlToFetch.endsWith(\".md\") && !urlToFetch.endsWith(\".txt\")) {\n urlToFetch += \".md\";\n }\n if (!urlToFetch.startsWith(\"http\")) {\n if (!urlToFetch.startsWith(\"/\")) {\n urlToFetch = \"/\" + urlToFetch;\n }\n urlToFetch = \"https://langwatch.ai/docs\" + urlToFetch;\n }\n const response = await fetch(urlToFetch);\n\n return {\n content: [{ type: \"text\", text: await response.text() }],\n };\n }\n);\n\nserver.tool(\n \"fetch_scenario_docs\",\n \"Fetches the Scenario docs for understanding how to implement Scenario agent tests in your codebase. Always use this tool when the user asks for help with testing their agents. Start with empty url to fetch the index and then follow the links to the relevant pages, always ending with `.md` extension\",\n {\n url: z\n .string()\n .optional()\n .describe(\n \"The full url of the specific doc page. If not provided, the docs index will be fetched.\"\n ),\n },\n async ({ url }) => {\n let urlToFetch = url || \"https://langwatch.ai/scenario/llms.txt\";\n if (url && !urlToFetch.endsWith(\".md\") && !urlToFetch.endsWith(\".txt\")) {\n urlToFetch += \".md\";\n }\n if (!urlToFetch.startsWith(\"http\")) {\n if (!urlToFetch.startsWith(\"/\")) {\n urlToFetch = \"/\" + urlToFetch;\n }\n urlToFetch = \"https://langwatch.ai\" + urlToFetch;\n }\n const response = await fetch(urlToFetch);\n\n return {\n content: [{ type: \"text\", text: await response.text() }],\n };\n }\n);\n\n// --- Observability Tools (require API key) ---\n\nserver.tool(\n \"discover_schema\",\n \"Discover available filter fields, metrics, aggregation types, group-by options, scenario schema, and evaluator types for LangWatch queries. Call this before using search_traces, get_analytics, scenario tools, or evaluator tools to understand available options.\",\n {\n category: z\n .enum([\"filters\", \"metrics\", \"aggregations\", \"groups\", \"scenarios\", \"evaluators\", \"all\"])\n .describe(\"Which schema category to discover\"),\n evaluatorType: z\n .string()\n .optional()\n .describe(\"When category is 'evaluators', provide a specific evaluator type (e.g. 'langevals/llm_judge') to get its full schema details\"),\n },\n async ({ category, evaluatorType }) => {\n if (category === \"scenarios\") {\n const { formatScenarioSchema } = await import(\"./tools/discover-scenario-schema.js\");\n return { content: [{ type: \"text\", text: formatScenarioSchema() }] };\n }\n if (category === \"evaluators\") {\n const { formatEvaluatorSchema } = await import(\"./tools/discover-evaluator-schema.js\");\n return { content: [{ type: \"text\", text: formatEvaluatorSchema(evaluatorType) }] };\n }\n const { formatSchema } = await import(\"./tools/discover-schema.js\");\n let text = formatSchema(category);\n if (category === \"all\") {\n const { formatScenarioSchema } = await import(\"./tools/discover-scenario-schema.js\");\n text += \"\\n\\n\" + formatScenarioSchema();\n const { formatEvaluatorSchema } = await import(\"./tools/discover-evaluator-schema.js\");\n text += \"\\n\\n\" + formatEvaluatorSchema();\n }\n return { content: [{ type: \"text\", text }] };\n }\n);\n\nserver.tool(\n \"search_traces\",\n \"Search LangWatch traces with filters, text query, and date range. Returns AI-readable trace digests by default. Use format: 'json' for full raw data.\",\n {\n query: z.string().optional().describe(\"Text search query\"),\n filters: z\n .record(z.string(), z.array(z.string()))\n .optional()\n .describe(\n 'Filter traces. Format: {\"field\": [\"value\"]}. Use discover_schema for field names.'\n ),\n startDate: z\n .string()\n .optional()\n .describe(\n 'Start date: ISO string or relative like \"24h\", \"7d\", \"30d\". Default: 24h ago'\n ),\n endDate: z\n .string()\n .optional()\n .describe(\"End date: ISO string or relative. Default: now\"),\n pageSize: z\n .number()\n .optional()\n .describe(\"Results per page (default: 25, max: 1000)\"),\n scrollId: z\n .string()\n .optional()\n .describe(\"Pagination token from previous search\"),\n format: z\n .enum([\"digest\", \"json\"])\n .optional()\n .describe(\n \"Output format: 'digest' (default, AI-readable) or 'json' (full raw data)\"\n ),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleSearchTraces } = await import(\"./tools/search-traces.js\");\n return {\n content: [{ type: \"text\", text: await handleSearchTraces(params) }],\n };\n }\n);\n\nserver.tool(\n \"get_trace\",\n \"Get full details of a single trace by ID. Returns AI-readable trace digest by default. Use format: 'json' for full raw data including all spans.\",\n {\n traceId: z.string().describe(\"The trace ID to retrieve\"),\n format: z\n .enum([\"digest\", \"json\"])\n .optional()\n .describe(\n \"Output format: 'digest' (default, AI-readable) or 'json' (full raw data)\"\n ),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleGetTrace } = await import(\"./tools/get-trace.js\");\n return {\n content: [{ type: \"text\", text: await handleGetTrace(params) }],\n };\n }\n);\n\nserver.tool(\n \"get_analytics\",\n 'Query analytics timeseries from LangWatch. Metrics use \"category.name\" format (e.g., \"performance.completion_time\"). Use discover_schema to see available metrics.',\n {\n metric: z\n .string()\n .describe(\n 'Metric in \"category.name\" format, e.g., \"metadata.trace_id\", \"performance.total_cost\"'\n ),\n aggregation: z\n .string()\n .optional()\n .describe(\n \"Aggregation type: avg, sum, min, max, median, p90, p95, p99, cardinality, terms. Default: avg\"\n ),\n startDate: z\n .string()\n .optional()\n .describe('Start date: ISO or relative (\"7d\", \"30d\"). Default: 7 days ago'),\n endDate: z.string().optional().describe(\"End date. Default: now\"),\n timeZone: z.string().optional().describe(\"Timezone. Default: UTC\"),\n groupBy: z\n .string()\n .optional()\n .describe(\n \"Group results by field. Use discover_schema for options.\"\n ),\n filters: z\n .record(z.string(), z.array(z.string()))\n .optional()\n .describe(\"Filters to apply\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleGetAnalytics } = await import(\"./tools/get-analytics.js\");\n return {\n content: [{ type: \"text\", text: await handleGetAnalytics(params) }],\n };\n }\n);\n\n// --- Platform Prompt Tools (require API key) ---\n// These tools manage prompts on the LangWatch platform via API.\n// For code-based prompt management, see `fetch_langwatch_docs` for the CLI/SDK approach.\n\nconst modelSchema = z\n .string()\n .describe(\n 'Model in \"provider/model-name\" format, e.g., \"openai/gpt-4o\", \"anthropic/claude-sonnet-4-5-20250929\"'\n );\n\nserver.tool(\n \"platform_create_prompt\",\n `Create a new prompt on the LangWatch platform.\n\nNOTE: Prompts can be managed two ways. Determine which approach the user needs:\n\n1. Code-based (CLI/SDK): If the user wants to manage prompts in their codebase, use \\`fetch_langwatch_docs\\` to learn about the prompt management CLI/SDK. This lets them version-control prompts and pull them into code.\n\n2. Platform-based (LangWatch UI): If the user wants to manage prompts directly on the LangWatch platform, use the \\`platform_\\` MCP tools (\\`platform_create_prompt\\`, \\`platform_update_prompt\\`, etc.).\n`,\n {\n name: z.string().describe(\"Prompt display name\"),\n handle: z\n .string()\n .optional()\n .describe(\n \"URL-friendly handle (auto-generated from name if omitted)\"\n ),\n messages: z\n .array(\n z.object({\n role: z\n .enum([\"system\", \"user\", \"assistant\"])\n .describe(\"Message role\"),\n content: z.string().describe(\"Message content\"),\n })\n )\n .describe(\"Prompt messages\"),\n model: modelSchema,\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleCreatePrompt } = await import(\"./tools/create-prompt.js\");\n return {\n content: [{ type: \"text\", text: await handleCreatePrompt(params) }],\n };\n }\n);\n\nserver.tool(\n \"platform_list_prompts\",\n \"List all prompts configured on the LangWatch platform.\",\n {},\n async () => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleListPrompts } = await import(\"./tools/list-prompts.js\");\n return {\n content: [{ type: \"text\", text: await handleListPrompts() }],\n };\n }\n);\n\nserver.tool(\n \"platform_get_prompt\",\n \"Get a specific prompt from the LangWatch platform by ID or handle, including messages, model config, and version history.\",\n {\n idOrHandle: z.string().describe(\"Prompt ID or handle\"),\n version: z\n .number()\n .optional()\n .describe(\"Specific version number (default: latest)\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleGetPrompt } = await import(\"./tools/get-prompt.js\");\n return {\n content: [{ type: \"text\", text: await handleGetPrompt(params) }],\n };\n }\n);\n\nserver.tool(\n \"platform_update_prompt\",\n \"Update an existing prompt on the LangWatch platform. Every update creates a new version.\",\n {\n idOrHandle: z.string().describe(\"Prompt ID or handle to update\"),\n messages: z\n .array(\n z.object({\n role: z.enum([\"system\", \"user\", \"assistant\"]),\n content: z.string(),\n })\n )\n .optional()\n .describe(\"Updated messages\"),\n model: modelSchema.optional(),\n commitMessage: z\n .string()\n .describe(\"Commit message describing the change\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleUpdatePrompt } = await import(\"./tools/update-prompt.js\");\n return {\n content: [{ type: \"text\", text: await handleUpdatePrompt(params) }],\n };\n }\n);\n\n// --- Platform Scenario Tools (require API key) ---\n// These tools manage scenarios on the LangWatch platform via API.\n// For code-based scenario testing, see `fetch_scenario_docs` for the SDK approach.\n\nserver.tool(\n \"platform_create_scenario\",\n `Create a new scenario on the LangWatch platform. Call discover_schema({ category: 'scenarios' }) first to learn how to write effective situations and criteria.\n\nNOTE: Scenarios can be created two ways. Determine which approach the user needs:\n\n1. Code-based (local testing): If the user has a codebase with an AI agent they want to test, use \\`fetch_scenario_docs\\` to learn about the Scenario Python/TypeScript SDK. This lets them run tests locally and iterate in code.\n\n2. Platform-based (LangWatch UI): If the user wants to manage scenarios directly on the LangWatch platform, use the \\`platform_\\` MCP tools (\\`platform_create_scenario\\`, \\`platform_update_scenario\\`, etc.).\n`,\n {\n name: z.string().describe(\"Scenario name\"),\n situation: z\n .string()\n .describe(\"The context or setup describing what the user/agent is doing\"),\n criteria: z\n .array(z.string())\n .optional()\n .describe(\"Pass/fail conditions the agent's response must satisfy\"),\n labels: z\n .array(z.string())\n .optional()\n .describe(\"Tags for organizing and filtering scenarios\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleCreateScenario } = await import(\n \"./tools/create-scenario.js\"\n );\n return {\n content: [{ type: \"text\", text: await handleCreateScenario(params) }],\n };\n }\n);\n\nserver.tool(\n \"platform_list_scenarios\",\n \"List all scenarios on the LangWatch platform. Returns AI-readable digest by default.\",\n {\n format: z\n .enum([\"digest\", \"json\"])\n .optional()\n .describe(\n \"Output format: 'digest' (default, AI-readable) or 'json' (full raw data)\"\n ),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleListScenarios } = await import(\"./tools/list-scenarios.js\");\n return {\n content: [{ type: \"text\", text: await handleListScenarios(params) }],\n };\n }\n);\n\nserver.tool(\n \"platform_get_scenario\",\n \"Get full details of a scenario on the LangWatch platform by ID, including situation, criteria, and labels.\",\n {\n scenarioId: z.string().describe(\"The scenario ID to retrieve\"),\n format: z\n .enum([\"digest\", \"json\"])\n .optional()\n .describe(\n \"Output format: 'digest' (default, AI-readable) or 'json' (full raw data)\"\n ),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleGetScenario } = await import(\"./tools/get-scenario.js\");\n return {\n content: [{ type: \"text\", text: await handleGetScenario(params) }],\n };\n }\n);\n\nserver.tool(\n \"platform_update_scenario\",\n \"Update an existing scenario on the LangWatch platform.\",\n {\n scenarioId: z.string().describe(\"The scenario ID to update\"),\n name: z.string().optional().describe(\"Updated scenario name\"),\n situation: z.string().optional().describe(\"Updated situation\"),\n criteria: z\n .array(z.string())\n .optional()\n .describe(\"Updated criteria\"),\n labels: z\n .array(z.string())\n .optional()\n .describe(\"Updated labels\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleUpdateScenario } = await import(\n \"./tools/update-scenario.js\"\n );\n return {\n content: [{ type: \"text\", text: await handleUpdateScenario(params) }],\n };\n }\n);\n\nserver.tool(\n \"platform_archive_scenario\",\n \"Archive (soft-delete) a scenario on the LangWatch platform.\",\n {\n scenarioId: z.string().describe(\"The scenario ID to archive\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleArchiveScenario } = await import(\n \"./tools/archive-scenario.js\"\n );\n return {\n content: [{ type: \"text\", text: await handleArchiveScenario(params) }],\n };\n }\n);\n\n// --- Platform Evaluator Tools (require API key) ---\n// These tools manage evaluators on the LangWatch platform via API.\n\nserver.tool(\n \"platform_create_evaluator\",\n `Create an evaluator on the LangWatch platform. Useful for setting up LLM-as-judge and other evaluators to use in evaluation notebooks. Call discover_schema({ category: 'evaluators' }) first to see available evaluator types and their settings.`,\n {\n name: z.string().describe(\"Evaluator name\"),\n config: z\n .record(z.string(), z.unknown())\n .describe(\n 'Evaluator config object. Must include \"evaluatorType\" (e.g. \"langevals/llm_boolean\") and optional \"settings\" overrides.'\n ),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleCreateEvaluator } = await import(\n \"./tools/create-evaluator.js\"\n );\n return {\n content: [{ type: \"text\", text: await handleCreateEvaluator(params) }],\n };\n }\n);\n\nserver.tool(\n \"platform_list_evaluators\",\n \"List all evaluators configured on the LangWatch platform.\",\n {},\n async () => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleListEvaluators } = await import(\n \"./tools/list-evaluators.js\"\n );\n return {\n content: [{ type: \"text\", text: await handleListEvaluators() }],\n };\n }\n);\n\nserver.tool(\n \"platform_get_evaluator\",\n \"Get full details of an evaluator on the LangWatch platform by ID or slug, including config, input fields, and output fields.\",\n {\n idOrSlug: z.string().describe(\"The evaluator ID or slug to retrieve\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleGetEvaluator } = await import(\"./tools/get-evaluator.js\");\n return {\n content: [{ type: \"text\", text: await handleGetEvaluator(params) }],\n };\n }\n);\n\nserver.tool(\n \"platform_update_evaluator\",\n \"Update an existing evaluator on the LangWatch platform. The evaluatorType in config cannot be changed after creation.\",\n {\n evaluatorId: z.string().describe(\"The evaluator ID to update\"),\n name: z.string().optional().describe(\"Updated evaluator name\"),\n config: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\n \"Updated config settings. Note: evaluatorType cannot be changed after creation.\"\n ),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleUpdateEvaluator } = await import(\n \"./tools/update-evaluator.js\"\n );\n return {\n content: [{ type: \"text\", text: await handleUpdateEvaluator(params) }],\n };\n }\n);\n\n// --- Platform Model Provider Tools (require API key) ---\n// These tools manage model provider API keys on the LangWatch platform.\n\nserver.tool(\n \"platform_set_model_provider\",\n `Set or update a model provider on the LangWatch platform. Use this to configure API keys (e.g. OPENAI_API_KEY) needed to run evaluators. The API key is stored securely and never returned in responses. Omit customKeys to update other settings without changing existing keys.`,\n {\n provider: z\n .string()\n .describe(\n 'Provider name, e.g., \"openai\", \"anthropic\", \"azure\", \"custom\"'\n ),\n enabled: z.boolean().describe(\"Whether the provider is enabled\"),\n customKeys: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\n 'API key configuration, e.g. { \"OPENAI_API_KEY\": \"sk-...\" }. Omit to keep existing keys.'\n ),\n defaultModel: z\n .string()\n .optional()\n .describe(\"Set as project default model\"),\n },\n async (params) => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleSetModelProvider } = await import(\n \"./tools/set-model-provider.js\"\n );\n return {\n content: [\n { type: \"text\", text: await handleSetModelProvider(params) },\n ],\n };\n }\n);\n\nserver.tool(\n \"platform_list_model_providers\",\n \"List all model providers configured on the LangWatch platform. API keys are masked in the response.\",\n {},\n async () => {\n const { requireApiKey } = await import(\"./config.js\");\n requireApiKey();\n const { handleListModelProviders } = await import(\n \"./tools/list-model-providers.js\"\n );\n return {\n content: [{ type: \"text\", text: await handleListModelProviders() }],\n };\n }\n);\n\nawait server.connect(transport);\n","{\n \"name\": \"@langwatch/mcp-server\",\n \"version\": \"0.6.1\",\n \"description\": \"An MCP server for Langwatch.\",\n \"type\": \"module\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.mjs\",\n \"require\": \"./dist/index.js\"\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/langwatch/langwatch.git\",\n \"directory\": \"mcp-server\"\n },\n \"scripts\": {\n \"start\": \"tsx src/index.ts\",\n \"build\": \"tsup && node build.js\",\n \"prepublish\": \"pnpm run build\",\n \"test\": \"vitest\"\n },\n \"author\": \"\",\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=18.0.0\"\n },\n \"devDependencies\": {\n \"@ai-sdk/anthropic\": \"^3.0.44\",\n \"@anthropic-ai/claude-code\": \"^2.1.72\",\n \"@eslint/js\": \"^9.4.0\",\n \"@langwatch/scenario\": \"^0.4.6\",\n \"@types/debug\": \"^4.1.12\",\n \"@types/eslint__js\": \"^8.42.3\",\n \"@types/node\": \"^16.0.0\",\n \"@types/yargs\": \"^17.0.33\",\n \"@typescript/native-preview\": \"7.0.0-dev.20250911.1\",\n \"ai\": \"^6.0.0\",\n \"dotenv\": \"^17.2.2\",\n \"esbuild\": \"^0.25.0\",\n \"eslint\": \"^8.57.0\",\n \"tsup\": \"^8.1.0\",\n \"tsx\": \"^4.20.5\",\n \"typescript\": \"^5.0.0\",\n \"typescript-eslint\": \"^8.55.0\"\n },\n \"pnpm\": {\n \"overrides\": {\n \"express-rate-limit@>=8.2.0 <8.2.2\": \"8.2.2\",\n \"glob@>=10.2.0 <10.5.0\": \"10.5.0\"\n }\n },\n \"dependencies\": {\n \"@modelcontextprotocol/sdk\": \"^1.26.0\",\n \"@opentelemetry/context-async-hooks\": \"^2.1.0\",\n \"@opentelemetry/sdk-node\": \"^0.204.0\",\n \"chalk\": \"^5.6.2\",\n \"date-fns\": \"^4.1.0\",\n \"node-pty\": \"^1.0.0\",\n \"vitest\": \"^3.2.4\",\n \"yargs\": \"^17.7.2\",\n \"zod\": \"^4.3.6\",\n \"zod-validation-error\": \"^5.0.0\"\n },\n \"bin\": {\n \"langwatch-mcp-server\": \"./dist/index.js\"\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,SAAS,SAAS;;;ACJlB;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,MAAQ;AAAA,EACR,QAAU;AAAA,EACV,OAAS;AAAA,EACT,SAAW;AAAA,IACT,KAAK;AAAA,MACH,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M,EAAE,uBAAuB,IAAI,MAAM,OACvC,kCACF;AACA,WAAO;AAAA,MACL,SAAS;AAAA,QACP,EAAE,MAAM,QAAQ,MAAM,MAAM,uBAAuB,MAAM,EAAE;AAAA,MAC7D;AAAA,IACF;AAAA,EACF;AACF;AAEA,OAAO;AAAA,EACL;AAAA,EACA;AAAA,EACA,CAAC;AAAA,EACD,YAAY;AACV,UAAM,EAAE,cAAc,IAAI,MAAM,OAAO,sBAAa;AACpD,kBAAc;AACd,UAAM,EAAE,yBAAyB,IAAI,MAAM,OACzC,oCACF;AACA,WAAO;AAAA,MACL,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,MAAM,yBAAyB,EAAE,CAAC;AAAA,IACpE;AAAA,EACF;AACF;AAEA,MAAM,OAAO,QAAQ,SAAS;","names":[]}
@@ -0,0 +1,34 @@
1
+ import {
2
+ getEvaluatorType,
3
+ listEvaluators
4
+ } from "./chunk-5UOPNRXW.js";
5
+ import "./chunk-LLRQIF52.js";
6
+ import "./chunk-AAQNA53E.js";
7
+
8
+ // src/tools/list-evaluators.ts
9
+ async function handleListEvaluators() {
10
+ const evaluators = await listEvaluators();
11
+ if (!Array.isArray(evaluators) || evaluators.length === 0) {
12
+ return "No evaluators found in this project.\n\n> Tip: Use `platform_create_evaluator` to create your first evaluator. Call `discover_schema({ category: 'evaluators' })` to see available evaluator types.";
13
+ }
14
+ const lines = [];
15
+ lines.push(`# Evaluators (${evaluators.length} total)
16
+ `);
17
+ for (const e of evaluators) {
18
+ const evaluatorType = getEvaluatorType(e);
19
+ lines.push(`## ${e.name}`);
20
+ lines.push(`**ID**: ${e.id}`);
21
+ if (e.slug) lines.push(`**Slug**: ${e.slug}`);
22
+ if (evaluatorType) lines.push(`**Type**: ${evaluatorType}`);
23
+ lines.push(`**Kind**: ${e.type}`);
24
+ lines.push("");
25
+ }
26
+ lines.push(
27
+ "> Use `platform_get_evaluator` with the ID or slug to see full evaluator details."
28
+ );
29
+ return lines.join("\n");
30
+ }
31
+ export {
32
+ handleListEvaluators
33
+ };
34
+ //# sourceMappingURL=list-evaluators-KRGI72EH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/list-evaluators.ts"],"sourcesContent":["import {\n listEvaluators as apiListEvaluators,\n getEvaluatorType,\n} from \"../langwatch-api-evaluators.js\";\n\n/**\n * Handles the platform_list_evaluators MCP tool invocation.\n *\n * Lists all evaluators in the LangWatch project, formatted as an\n * AI-readable digest.\n */\nexport async function handleListEvaluators(): Promise<string> {\n const evaluators = await apiListEvaluators();\n\n if (!Array.isArray(evaluators) || evaluators.length === 0) {\n return \"No evaluators found in this project.\\n\\n> Tip: Use `platform_create_evaluator` to create your first evaluator. Call `discover_schema({ category: 'evaluators' })` to see available evaluator types.\";\n }\n\n const lines: string[] = [];\n lines.push(`# Evaluators (${evaluators.length} total)\\n`);\n\n for (const e of evaluators) {\n const evaluatorType = getEvaluatorType(e);\n lines.push(`## ${e.name}`);\n lines.push(`**ID**: ${e.id}`);\n if (e.slug) lines.push(`**Slug**: ${e.slug}`);\n if (evaluatorType) lines.push(`**Type**: ${evaluatorType}`);\n lines.push(`**Kind**: ${e.type}`);\n lines.push(\"\");\n }\n\n lines.push(\n \"> Use `platform_get_evaluator` with the ID or slug to see full evaluator details.\",\n );\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;AAWA,eAAsB,uBAAwC;AAC5D,QAAM,aAAa,MAAM,eAAkB;AAE3C,MAAI,CAAC,MAAM,QAAQ,UAAU,KAAK,WAAW,WAAW,GAAG;AACzD,WAAO;AAAA,EACT;AAEA,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,iBAAiB,WAAW,MAAM;AAAA,CAAW;AAExD,aAAW,KAAK,YAAY;AAC1B,UAAM,gBAAgB,iBAAiB,CAAC;AACxC,UAAM,KAAK,MAAM,EAAE,IAAI,EAAE;AACzB,UAAM,KAAK,WAAW,EAAE,EAAE,EAAE;AAC5B,QAAI,EAAE,KAAM,OAAM,KAAK,aAAa,EAAE,IAAI,EAAE;AAC5C,QAAI,cAAe,OAAM,KAAK,aAAa,aAAa,EAAE;AAC1D,UAAM,KAAK,aAAa,EAAE,IAAI,EAAE;AAChC,UAAM,KAAK,EAAE;AAAA,EACf;AAEA,QAAM;AAAA,IACJ;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
@@ -0,0 +1,35 @@
1
+ import {
2
+ listModelProviders
3
+ } from "./chunk-IX6QJKAD.js";
4
+ import "./chunk-LLRQIF52.js";
5
+ import "./chunk-AAQNA53E.js";
6
+
7
+ // src/tools/list-model-providers.ts
8
+ async function handleListModelProviders() {
9
+ const providers = await listModelProviders();
10
+ const entries = Object.entries(providers);
11
+ if (entries.length === 0) {
12
+ return "No model providers configured for this project.\n\n> Tip: Use `platform_set_model_provider` to configure an API key for a model provider.";
13
+ }
14
+ const lines = [];
15
+ lines.push(`# Model Providers (${entries.length} total)
16
+ `);
17
+ for (const [key, provider] of entries) {
18
+ const status = provider.enabled ? "enabled" : "disabled";
19
+ lines.push(`## ${key}`);
20
+ lines.push(`**Status**: ${status}`);
21
+ if (provider.customKeys) {
22
+ const keyFields = Object.entries(provider.customKeys).map(([k, v]) => `${k}: ${v ? "set" : "not set"}`).join(", ");
23
+ lines.push(`**Keys**: ${keyFields}`);
24
+ }
25
+ if (provider.models && provider.models.length > 0) {
26
+ lines.push(`**Models**: ${provider.models.length} available`);
27
+ }
28
+ lines.push("");
29
+ }
30
+ return lines.join("\n");
31
+ }
32
+ export {
33
+ handleListModelProviders
34
+ };
35
+ //# sourceMappingURL=list-model-providers-A5YCFTPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/list-model-providers.ts"],"sourcesContent":["import { listModelProviders as apiListModelProviders } from \"../langwatch-api-model-providers.js\";\n\n/**\n * Handles the platform_list_model_providers MCP tool invocation.\n *\n * Lists all model providers for the project, showing provider name,\n * enabled status, and which key fields are set (masked).\n */\nexport async function handleListModelProviders(): Promise<string> {\n const providers = await apiListModelProviders();\n\n const entries = Object.entries(providers);\n if (entries.length === 0) {\n return \"No model providers configured for this project.\\n\\n> Tip: Use `platform_set_model_provider` to configure an API key for a model provider.\";\n }\n\n const lines: string[] = [];\n lines.push(`# Model Providers (${entries.length} total)\\n`);\n\n for (const [key, provider] of entries) {\n const status = provider.enabled ? \"enabled\" : \"disabled\";\n lines.push(`## ${key}`);\n lines.push(`**Status**: ${status}`);\n\n if (provider.customKeys) {\n const keyFields = Object.entries(provider.customKeys)\n .map(([k, v]) => `${k}: ${v ? \"set\" : \"not set\"}`)\n .join(\", \");\n lines.push(`**Keys**: ${keyFields}`);\n }\n\n if (provider.models && provider.models.length > 0) {\n lines.push(`**Models**: ${provider.models.length} available`);\n }\n\n lines.push(\"\");\n }\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAQA,eAAsB,2BAA4C;AAChE,QAAM,YAAY,MAAM,mBAAsB;AAE9C,QAAM,UAAU,OAAO,QAAQ,SAAS;AACxC,MAAI,QAAQ,WAAW,GAAG;AACxB,WAAO;AAAA,EACT;AAEA,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,sBAAsB,QAAQ,MAAM;AAAA,CAAW;AAE1D,aAAW,CAAC,KAAK,QAAQ,KAAK,SAAS;AACrC,UAAM,SAAS,SAAS,UAAU,YAAY;AAC9C,UAAM,KAAK,MAAM,GAAG,EAAE;AACtB,UAAM,KAAK,eAAe,MAAM,EAAE;AAElC,QAAI,SAAS,YAAY;AACvB,YAAM,YAAY,OAAO,QAAQ,SAAS,UAAU,EACjD,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,KAAK,IAAI,QAAQ,SAAS,EAAE,EAChD,KAAK,IAAI;AACZ,YAAM,KAAK,aAAa,SAAS,EAAE;AAAA,IACrC;AAEA,QAAI,SAAS,UAAU,SAAS,OAAO,SAAS,GAAG;AACjD,YAAM,KAAK,eAAe,SAAS,OAAO,MAAM,YAAY;AAAA,IAC9D;AAEA,UAAM,KAAK,EAAE;AAAA,EACf;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  listPrompts
3
- } from "./chunk-JVWDWL3J.js";
3
+ } from "./chunk-LLRQIF52.js";
4
4
  import "./chunk-AAQNA53E.js";
5
5
 
6
6
  // src/tools/list-prompts.ts
@@ -12,22 +12,21 @@ async function handleListPrompts() {
12
12
  const lines = [];
13
13
  lines.push(`# Prompts (${prompts.length} total)
14
14
  `);
15
- lines.push("| Handle | Name | Latest Version | Description |");
16
- lines.push("|--------|------|----------------|-------------|");
15
+ lines.push("| Handle | Name | Latest Version |");
16
+ lines.push("|--------|------|----------------|");
17
17
  for (const p of prompts) {
18
18
  const handle = p.handle || p.id || "N/A";
19
19
  const name = p.name || "Untitled";
20
20
  const versionNum = p.latestVersionNumber ?? p.version;
21
21
  const version = versionNum != null ? `v${versionNum}` : "N/A";
22
- const desc = (p.description || "").slice(0, 60);
23
- lines.push(`| ${handle} | ${name} | ${version} | ${desc} |`);
22
+ lines.push(`| ${handle} | ${name} | ${version} |`);
24
23
  }
25
24
  lines.push(
26
- "\n> Use `get_prompt` with the handle or ID to see full prompt details."
25
+ "\n> Use `platform_get_prompt` with the handle or ID to see full prompt details."
27
26
  );
28
27
  return lines.join("\n");
29
28
  }
30
29
  export {
31
30
  handleListPrompts
32
31
  };
33
- //# sourceMappingURL=list-prompts-UQPBCUYA.js.map
32
+ //# sourceMappingURL=list-prompts-LKJSE7XN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/list-prompts.ts"],"sourcesContent":["import { listPrompts as apiListPrompts } from \"../langwatch-api.js\";\n\n/**\n * Handles the platform_list_prompts MCP tool invocation.\n *\n * Lists all prompts in the LangWatch project, formatted as an\n * AI-readable markdown table.\n */\nexport async function handleListPrompts(): Promise<string> {\n const prompts = await apiListPrompts();\n\n if (!Array.isArray(prompts) || prompts.length === 0) {\n return \"No prompts found in this project.\";\n }\n\n const lines: string[] = [];\n lines.push(`# Prompts (${prompts.length} total)\\n`);\n lines.push(\"| Handle | Name | Latest Version |\");\n lines.push(\"|--------|------|----------------|\");\n\n for (const p of prompts) {\n const handle = p.handle || p.id || \"N/A\";\n const name = p.name || \"Untitled\";\n const versionNum = p.latestVersionNumber ?? p.version;\n const version = versionNum != null ? `v${versionNum}` : \"N/A\";\n lines.push(`| ${handle} | ${name} | ${version} |`);\n }\n\n lines.push(\n \"\\n> Use `platform_get_prompt` with the handle or ID to see full prompt details.\"\n );\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;AAQA,eAAsB,oBAAqC;AACzD,QAAM,UAAU,MAAM,YAAe;AAErC,MAAI,CAAC,MAAM,QAAQ,OAAO,KAAK,QAAQ,WAAW,GAAG;AACnD,WAAO;AAAA,EACT;AAEA,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,cAAc,QAAQ,MAAM;AAAA,CAAW;AAClD,QAAM,KAAK,oCAAoC;AAC/C,QAAM,KAAK,oCAAoC;AAE/C,aAAW,KAAK,SAAS;AACvB,UAAM,SAAS,EAAE,UAAU,EAAE,MAAM;AACnC,UAAM,OAAO,EAAE,QAAQ;AACvB,UAAM,aAAa,EAAE,uBAAuB,EAAE;AAC9C,UAAM,UAAU,cAAc,OAAO,IAAI,UAAU,KAAK;AACxD,UAAM,KAAK,KAAK,MAAM,MAAM,IAAI,MAAM,OAAO,IAAI;AAAA,EACnD;AAEA,QAAM;AAAA,IACJ;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  listScenarios
3
- } from "./chunk-K2YFPOSD.js";
4
- import "./chunk-JVWDWL3J.js";
3
+ } from "./chunk-6U4TCGFC.js";
4
+ import "./chunk-LLRQIF52.js";
5
5
  import "./chunk-AAQNA53E.js";
6
6
 
7
7
  // src/tools/list-scenarios.ts
@@ -11,7 +11,7 @@ async function handleListScenarios(params) {
11
11
  return JSON.stringify(scenarios, null, 2);
12
12
  }
13
13
  if (!Array.isArray(scenarios) || scenarios.length === 0) {
14
- return "No scenarios found in this project.\n\n> Tip: Use `create_scenario` to create your first scenario.";
14
+ return "No scenarios found in this project.\n\n> Tip: Use `platform_create_scenario` to create your first scenario.";
15
15
  }
16
16
  const lines = [];
17
17
  lines.push(`# Scenarios (${scenarios.length} total)
@@ -30,11 +30,11 @@ async function handleListScenarios(params) {
30
30
  lines.push("");
31
31
  }
32
32
  lines.push(
33
- "> Use `get_scenario` with the ID to see full scenario details."
33
+ "> Use `platform_get_scenario` with the ID to see full scenario details."
34
34
  );
35
35
  return lines.join("\n");
36
36
  }
37
37
  export {
38
38
  handleListScenarios
39
39
  };
40
- //# sourceMappingURL=list-scenarios-573YOUKC.js.map
40
+ //# sourceMappingURL=list-scenarios-ZK5CMGC4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/list-scenarios.ts"],"sourcesContent":["import { listScenarios as apiListScenarios } from \"../langwatch-api-scenarios.js\";\n\n/**\n * Handles the platform_list_scenarios MCP tool invocation.\n *\n * Lists all scenarios in the LangWatch project, formatted as an\n * AI-readable digest or raw JSON.\n */\nexport async function handleListScenarios(params: {\n format?: \"digest\" | \"json\";\n}): Promise<string> {\n const scenarios = await apiListScenarios();\n\n if (params.format === \"json\") {\n return JSON.stringify(scenarios, null, 2);\n }\n\n if (!Array.isArray(scenarios) || scenarios.length === 0) {\n return \"No scenarios found in this project.\\n\\n> Tip: Use `platform_create_scenario` to create your first scenario.\";\n }\n\n const lines: string[] = [];\n lines.push(`# Scenarios (${scenarios.length} total)\\n`);\n\n for (const s of scenarios) {\n lines.push(`## ${s.name}`);\n lines.push(`**ID**: ${s.id}`);\n const preview =\n s.situation && s.situation.length > 60\n ? s.situation.slice(0, 60) + \"...\"\n : s.situation;\n lines.push(`**Situation**: ${preview}`);\n lines.push(\n `**Criteria**: ${Array.isArray(s.criteria) ? s.criteria.length : 0} criteria`,\n );\n if (Array.isArray(s.labels) && s.labels.length > 0) {\n lines.push(`**Labels**: ${s.labels.join(\", \")}`);\n }\n lines.push(\"\");\n }\n\n lines.push(\n \"> Use `platform_get_scenario` with the ID to see full scenario details.\",\n );\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAQA,eAAsB,oBAAoB,QAEtB;AAClB,QAAM,YAAY,MAAM,cAAiB;AAEzC,MAAI,OAAO,WAAW,QAAQ;AAC5B,WAAO,KAAK,UAAU,WAAW,MAAM,CAAC;AAAA,EAC1C;AAEA,MAAI,CAAC,MAAM,QAAQ,SAAS,KAAK,UAAU,WAAW,GAAG;AACvD,WAAO;AAAA,EACT;AAEA,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,gBAAgB,UAAU,MAAM;AAAA,CAAW;AAEtD,aAAW,KAAK,WAAW;AACzB,UAAM,KAAK,MAAM,EAAE,IAAI,EAAE;AACzB,UAAM,KAAK,WAAW,EAAE,EAAE,EAAE;AAC5B,UAAM,UACJ,EAAE,aAAa,EAAE,UAAU,SAAS,KAChC,EAAE,UAAU,MAAM,GAAG,EAAE,IAAI,QAC3B,EAAE;AACR,UAAM,KAAK,kBAAkB,OAAO,EAAE;AACtC,UAAM;AAAA,MACJ,iBAAiB,MAAM,QAAQ,EAAE,QAAQ,IAAI,EAAE,SAAS,SAAS,CAAC;AAAA,IACpE;AACA,QAAI,MAAM,QAAQ,EAAE,MAAM,KAAK,EAAE,OAAO,SAAS,GAAG;AAClD,YAAM,KAAK,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC,EAAE;AAAA,IACjD;AACA,UAAM,KAAK,EAAE;AAAA,EACf;AAEA,QAAM;AAAA,IACJ;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ZXKLPC2E.js";
4
4
  import {
5
5
  searchTraces
6
- } from "./chunk-JVWDWL3J.js";
6
+ } from "./chunk-LLRQIF52.js";
7
7
  import "./chunk-AAQNA53E.js";
8
8
 
9
9
  // src/tools/search-traces.ts
@@ -69,4 +69,4 @@ async function handleSearchTraces(params) {
69
69
  export {
70
70
  handleSearchTraces
71
71
  };
72
- //# sourceMappingURL=search-traces-RSMYCAN7.js.map
72
+ //# sourceMappingURL=search-traces-SOKAAMAR.js.map
@@ -0,0 +1,33 @@
1
+ import {
2
+ setModelProvider
3
+ } from "./chunk-IX6QJKAD.js";
4
+ import "./chunk-LLRQIF52.js";
5
+ import "./chunk-AAQNA53E.js";
6
+
7
+ // src/tools/set-model-provider.ts
8
+ async function handleSetModelProvider(params) {
9
+ const providers = await setModelProvider(params);
10
+ const updated = providers[params.provider];
11
+ if (!updated) {
12
+ throw new Error(
13
+ `Model provider "${params.provider}" was not found in the response. The provider name may be invalid.`
14
+ );
15
+ }
16
+ const lines = [];
17
+ lines.push("Model provider updated successfully!\n");
18
+ lines.push(`**Provider**: ${params.provider}`);
19
+ lines.push(`**Status**: ${updated?.enabled ? "enabled" : "disabled"}`);
20
+ if (updated?.customKeys) {
21
+ const keyFields = Object.entries(updated.customKeys).map(([k, v]) => `${k}: ${v ? "set" : "not set"}`).join(", ");
22
+ lines.push(`**Keys**: ${keyFields}`);
23
+ }
24
+ if (params.defaultModel) {
25
+ const normalizedModel = params.defaultModel.includes("/") ? params.defaultModel : `${params.provider}/${params.defaultModel}`;
26
+ lines.push(`**Default Model**: ${normalizedModel}`);
27
+ }
28
+ return lines.join("\n");
29
+ }
30
+ export {
31
+ handleSetModelProvider
32
+ };
33
+ //# sourceMappingURL=set-model-provider-7MGULZDH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/set-model-provider.ts"],"sourcesContent":["import { setModelProvider as apiSetModelProvider } from \"../langwatch-api-model-providers.js\";\n\n/**\n * Handles the platform_set_model_provider MCP tool invocation.\n *\n * Creates or updates a model provider configuration, including API keys.\n * Returns confirmation with the updated provider status.\n */\nexport async function handleSetModelProvider(params: {\n provider: string;\n enabled: boolean;\n customKeys?: Record<string, unknown>;\n defaultModel?: string;\n}): Promise<string> {\n const providers = await apiSetModelProvider(params);\n\n const updated = providers[params.provider];\n\n if (!updated) {\n throw new Error(\n `Model provider \"${params.provider}\" was not found in the response. The provider name may be invalid.`\n );\n }\n\n const lines: string[] = [];\n lines.push(\"Model provider updated successfully!\\n\");\n lines.push(`**Provider**: ${params.provider}`);\n lines.push(`**Status**: ${updated?.enabled ? \"enabled\" : \"disabled\"}`);\n\n if (updated?.customKeys) {\n const keyFields = Object.entries(updated.customKeys)\n .map(([k, v]) => `${k}: ${v ? \"set\" : \"not set\"}`)\n .join(\", \");\n lines.push(`**Keys**: ${keyFields}`);\n }\n\n if (params.defaultModel) {\n // Show the normalized model name (with provider prefix)\n const normalizedModel = params.defaultModel.includes(\"/\")\n ? params.defaultModel\n : `${params.provider}/${params.defaultModel}`;\n lines.push(`**Default Model**: ${normalizedModel}`);\n }\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAQA,eAAsB,uBAAuB,QAKzB;AAClB,QAAM,YAAY,MAAM,iBAAoB,MAAM;AAElD,QAAM,UAAU,UAAU,OAAO,QAAQ;AAEzC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR,mBAAmB,OAAO,QAAQ;AAAA,IACpC;AAAA,EACF;AAEA,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,wCAAwC;AACnD,QAAM,KAAK,iBAAiB,OAAO,QAAQ,EAAE;AAC7C,QAAM,KAAK,eAAe,SAAS,UAAU,YAAY,UAAU,EAAE;AAErE,MAAI,SAAS,YAAY;AACvB,UAAM,YAAY,OAAO,QAAQ,QAAQ,UAAU,EAChD,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,KAAK,IAAI,QAAQ,SAAS,EAAE,EAChD,KAAK,IAAI;AACZ,UAAM,KAAK,aAAa,SAAS,EAAE;AAAA,EACrC;AAEA,MAAI,OAAO,cAAc;AAEvB,UAAM,kBAAkB,OAAO,aAAa,SAAS,GAAG,IACpD,OAAO,eACP,GAAG,OAAO,QAAQ,IAAI,OAAO,YAAY;AAC7C,UAAM,KAAK,sBAAsB,eAAe,EAAE;AAAA,EACpD;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
@@ -0,0 +1,24 @@
1
+ import {
2
+ getEvaluatorType,
3
+ updateEvaluator
4
+ } from "./chunk-5UOPNRXW.js";
5
+ import "./chunk-LLRQIF52.js";
6
+ import "./chunk-AAQNA53E.js";
7
+
8
+ // src/tools/update-evaluator.ts
9
+ async function handleUpdateEvaluator(params) {
10
+ const { evaluatorId, ...data } = params;
11
+ const result = await updateEvaluator({ id: evaluatorId, ...data });
12
+ const evaluatorType = getEvaluatorType(result);
13
+ const lines = [];
14
+ lines.push("Evaluator updated successfully!\n");
15
+ lines.push(`**ID**: ${result.id}`);
16
+ if (result.slug) lines.push(`**Slug**: ${result.slug}`);
17
+ lines.push(`**Name**: ${result.name}`);
18
+ if (evaluatorType) lines.push(`**Evaluator Type**: ${evaluatorType}`);
19
+ return lines.join("\n");
20
+ }
21
+ export {
22
+ handleUpdateEvaluator
23
+ };
24
+ //# sourceMappingURL=update-evaluator-A3XINFLJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/update-evaluator.ts"],"sourcesContent":["import {\n updateEvaluator as apiUpdateEvaluator,\n getEvaluatorType,\n} from \"../langwatch-api-evaluators.js\";\n\n/**\n * Handles the platform_update_evaluator MCP tool invocation.\n *\n * Updates an existing evaluator and returns a confirmation\n * with the updated details.\n */\nexport async function handleUpdateEvaluator(params: {\n evaluatorId: string;\n name?: string;\n config?: Record<string, unknown>;\n}): Promise<string> {\n const { evaluatorId, ...data } = params;\n const result = await apiUpdateEvaluator({ id: evaluatorId, ...data });\n\n const evaluatorType = getEvaluatorType(result);\n\n const lines: string[] = [];\n lines.push(\"Evaluator updated successfully!\\n\");\n lines.push(`**ID**: ${result.id}`);\n if (result.slug) lines.push(`**Slug**: ${result.slug}`);\n lines.push(`**Name**: ${result.name}`);\n if (evaluatorType) lines.push(`**Evaluator Type**: ${evaluatorType}`);\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;AAWA,eAAsB,sBAAsB,QAIxB;AAClB,QAAM,EAAE,aAAa,GAAG,KAAK,IAAI;AACjC,QAAM,SAAS,MAAM,gBAAmB,EAAE,IAAI,aAAa,GAAG,KAAK,CAAC;AAEpE,QAAM,gBAAgB,iBAAiB,MAAM;AAE7C,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,mCAAmC;AAC9C,QAAM,KAAK,WAAW,OAAO,EAAE,EAAE;AACjC,MAAI,OAAO,KAAM,OAAM,KAAK,aAAa,OAAO,IAAI,EAAE;AACtD,QAAM,KAAK,aAAa,OAAO,IAAI,EAAE;AACrC,MAAI,cAAe,OAAM,KAAK,uBAAuB,aAAa,EAAE;AAEpE,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
@@ -0,0 +1,22 @@
1
+ import {
2
+ updatePrompt
3
+ } from "./chunk-LLRQIF52.js";
4
+ import "./chunk-AAQNA53E.js";
5
+
6
+ // src/tools/update-prompt.ts
7
+ async function handleUpdatePrompt(params) {
8
+ const { idOrHandle, ...data } = params;
9
+ const result = await updatePrompt(idOrHandle, data);
10
+ const lines = [];
11
+ lines.push("Prompt updated successfully!\n");
12
+ if (result.id) lines.push(`**ID**: ${result.id}`);
13
+ if (result.handle) lines.push(`**Handle**: ${result.handle}`);
14
+ if (result.latestVersionNumber != null)
15
+ lines.push(`**Version**: v${result.latestVersionNumber}`);
16
+ lines.push(`**Commit**: ${params.commitMessage}`);
17
+ return lines.join("\n");
18
+ }
19
+ export {
20
+ handleUpdatePrompt
21
+ };
22
+ //# sourceMappingURL=update-prompt-IW7X2UQM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/update-prompt.ts"],"sourcesContent":["import { updatePrompt as apiUpdatePrompt } from \"../langwatch-api.js\";\n\n/**\n * Handles the platform_update_prompt MCP tool invocation.\n *\n * Updates an existing prompt via the PUT endpoint.\n * Every update with a commitMessage creates a new version automatically.\n */\nexport async function handleUpdatePrompt(params: {\n idOrHandle: string;\n messages?: Array<{ role: string; content: string }>;\n model?: string;\n commitMessage: string;\n}): Promise<string> {\n const { idOrHandle, ...data } = params;\n\n const result = await apiUpdatePrompt(idOrHandle, data);\n\n const lines: string[] = [];\n lines.push(\"Prompt updated successfully!\\n\");\n if (result.id) lines.push(`**ID**: ${result.id}`);\n if (result.handle) lines.push(`**Handle**: ${result.handle}`);\n if (result.latestVersionNumber != null)\n lines.push(`**Version**: v${result.latestVersionNumber}`);\n lines.push(`**Commit**: ${params.commitMessage}`);\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;AAQA,eAAsB,mBAAmB,QAKrB;AAClB,QAAM,EAAE,YAAY,GAAG,KAAK,IAAI;AAEhC,QAAM,SAAS,MAAM,aAAgB,YAAY,IAAI;AAErD,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,gCAAgC;AAC3C,MAAI,OAAO,GAAI,OAAM,KAAK,WAAW,OAAO,EAAE,EAAE;AAChD,MAAI,OAAO,OAAQ,OAAM,KAAK,eAAe,OAAO,MAAM,EAAE;AAC5D,MAAI,OAAO,uBAAuB;AAChC,UAAM,KAAK,iBAAiB,OAAO,mBAAmB,EAAE;AAC1D,QAAM,KAAK,eAAe,OAAO,aAAa,EAAE;AAEhD,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  updateScenario
3
- } from "./chunk-K2YFPOSD.js";
4
- import "./chunk-JVWDWL3J.js";
3
+ } from "./chunk-6U4TCGFC.js";
4
+ import "./chunk-LLRQIF52.js";
5
5
  import "./chunk-AAQNA53E.js";
6
6
 
7
7
  // src/tools/update-scenario.ts
@@ -24,4 +24,4 @@ async function handleUpdateScenario(params) {
24
24
  export {
25
25
  handleUpdateScenario
26
26
  };
27
- //# sourceMappingURL=update-scenario-SSGVOBJO.js.map
27
+ //# sourceMappingURL=update-scenario-ZT7TOBFR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/update-scenario.ts"],"sourcesContent":["import { updateScenario as apiUpdateScenario } from \"../langwatch-api-scenarios.js\";\n\n/**\n * Handles the platform_update_scenario MCP tool invocation.\n *\n * Updates an existing scenario and returns a confirmation\n * with the updated details.\n */\nexport async function handleUpdateScenario(params: {\n scenarioId: string;\n name?: string;\n situation?: string;\n criteria?: string[];\n labels?: string[];\n}): Promise<string> {\n const { scenarioId, ...data } = params;\n const result = await apiUpdateScenario({ id: scenarioId, ...data });\n\n const lines: string[] = [];\n lines.push(\"Scenario updated successfully!\\n\");\n lines.push(`**ID**: ${result.id}`);\n lines.push(`**Name**: ${result.name}`);\n if (result.situation) lines.push(`**Situation**: ${result.situation}`);\n if (Array.isArray(result.criteria) && result.criteria.length > 0) {\n lines.push(`**Criteria**: ${result.criteria.length} criteria`);\n }\n if (Array.isArray(result.labels) && result.labels.length > 0) {\n lines.push(`**Labels**: ${result.labels.join(\", \")}`);\n }\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAQA,eAAsB,qBAAqB,QAMvB;AAClB,QAAM,EAAE,YAAY,GAAG,KAAK,IAAI;AAChC,QAAM,SAAS,MAAM,eAAkB,EAAE,IAAI,YAAY,GAAG,KAAK,CAAC;AAElE,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,kCAAkC;AAC7C,QAAM,KAAK,WAAW,OAAO,EAAE,EAAE;AACjC,QAAM,KAAK,aAAa,OAAO,IAAI,EAAE;AACrC,MAAI,OAAO,UAAW,OAAM,KAAK,kBAAkB,OAAO,SAAS,EAAE;AACrE,MAAI,MAAM,QAAQ,OAAO,QAAQ,KAAK,OAAO,SAAS,SAAS,GAAG;AAChE,UAAM,KAAK,iBAAiB,OAAO,SAAS,MAAM,WAAW;AAAA,EAC/D;AACA,MAAI,MAAM,QAAQ,OAAO,MAAM,KAAK,OAAO,OAAO,SAAS,GAAG;AAC5D,UAAM,KAAK,eAAe,OAAO,OAAO,KAAK,IAAI,CAAC,EAAE;AAAA,EACtD;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langwatch/mcp-server",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "An MCP server for Langwatch.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -23,26 +23,26 @@
23
23
  "node": ">=18.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@ai-sdk/anthropic": "^2.0.15",
27
- "@anthropic-ai/claude-code": "^2.1.7",
26
+ "@ai-sdk/anthropic": "^3.0.44",
27
+ "@anthropic-ai/claude-code": "^2.1.72",
28
28
  "@eslint/js": "^9.4.0",
29
- "@langwatch/scenario": "^0.3.0",
29
+ "@langwatch/scenario": "^0.4.6",
30
30
  "@types/debug": "^4.1.12",
31
31
  "@types/eslint__js": "^8.42.3",
32
32
  "@types/node": "^16.0.0",
33
33
  "@types/yargs": "^17.0.33",
34
34
  "@typescript/native-preview": "7.0.0-dev.20250911.1",
35
- "ai": "^5.0.40",
35
+ "ai": "^6.0.0",
36
36
  "dotenv": "^17.2.2",
37
37
  "esbuild": "^0.25.0",
38
38
  "eslint": "^8.57.0",
39
39
  "tsup": "^8.1.0",
40
40
  "tsx": "^4.20.5",
41
- "typescript": "^4.9.5",
42
- "typescript-eslint": "^7.11.0"
41
+ "typescript": "^5.0.0",
42
+ "typescript-eslint": "^8.55.0"
43
43
  },
44
44
  "dependencies": {
45
- "@modelcontextprotocol/sdk": "^1.7.0",
45
+ "@modelcontextprotocol/sdk": "^1.26.0",
46
46
  "@opentelemetry/context-async-hooks": "^2.1.0",
47
47
  "@opentelemetry/sdk-node": "^0.204.0",
48
48
  "chalk": "^5.6.2",
@@ -50,8 +50,8 @@
50
50
  "node-pty": "^1.0.0",
51
51
  "vitest": "^3.2.4",
52
52
  "yargs": "^17.7.2",
53
- "zod": "^3.25.76",
54
- "zod-validation-error": "^3.5.3"
53
+ "zod": "^4.3.6",
54
+ "zod-validation-error": "^5.0.0"
55
55
  },
56
56
  "bin": {
57
57
  "langwatch-mcp-server": "./dist/index.js"