@cesteral/dbm-mcp 1.0.0

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 (227) hide show
  1. package/LICENSE.md +201 -0
  2. package/README.md +197 -0
  3. package/dist/config/index.d.ts +112 -0
  4. package/dist/config/index.d.ts.map +1 -0
  5. package/dist/config/index.js +55 -0
  6. package/dist/config/index.js.map +1 -0
  7. package/dist/generated/compatibility-rules.d.ts +26 -0
  8. package/dist/generated/compatibility-rules.d.ts.map +1 -0
  9. package/dist/generated/compatibility-rules.js +142 -0
  10. package/dist/generated/compatibility-rules.js.map +1 -0
  11. package/dist/generated/filters.d.ts +19 -0
  12. package/dist/generated/filters.d.ts.map +1 -0
  13. package/dist/generated/filters.js +2541 -0
  14. package/dist/generated/filters.js.map +1 -0
  15. package/dist/generated/index.d.ts +5 -0
  16. package/dist/generated/index.d.ts.map +1 -0
  17. package/dist/generated/index.js +5 -0
  18. package/dist/generated/index.js.map +1 -0
  19. package/dist/generated/metrics.d.ts +28 -0
  20. package/dist/generated/metrics.d.ts.map +1 -0
  21. package/dist/generated/metrics.js +961 -0
  22. package/dist/generated/metrics.js.map +1 -0
  23. package/dist/generated/report-types.d.ts +14 -0
  24. package/dist/generated/report-types.d.ts.map +1 -0
  25. package/dist/generated/report-types.js +94 -0
  26. package/dist/generated/report-types.js.map +1 -0
  27. package/dist/index.d.ts +3 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +51 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/mcp-server/prompts/definitions/cross-platform-campaign-setup.prompt.d.ts +4 -0
  32. package/dist/mcp-server/prompts/definitions/cross-platform-campaign-setup.prompt.d.ts.map +1 -0
  33. package/dist/mcp-server/prompts/definitions/cross-platform-campaign-setup.prompt.js +299 -0
  34. package/dist/mcp-server/prompts/definitions/cross-platform-campaign-setup.prompt.js.map +1 -0
  35. package/dist/mcp-server/prompts/definitions/cross-platform-performance.prompt.d.ts +4 -0
  36. package/dist/mcp-server/prompts/definitions/cross-platform-performance.prompt.d.ts.map +1 -0
  37. package/dist/mcp-server/prompts/definitions/cross-platform-performance.prompt.js +170 -0
  38. package/dist/mcp-server/prompts/definitions/cross-platform-performance.prompt.js.map +1 -0
  39. package/dist/mcp-server/prompts/definitions/custom-query-workflow.prompt.d.ts +4 -0
  40. package/dist/mcp-server/prompts/definitions/custom-query-workflow.prompt.d.ts.map +1 -0
  41. package/dist/mcp-server/prompts/definitions/custom-query-workflow.prompt.js +164 -0
  42. package/dist/mcp-server/prompts/definitions/custom-query-workflow.prompt.js.map +1 -0
  43. package/dist/mcp-server/prompts/definitions/pacing-performance-analysis.prompt.d.ts +4 -0
  44. package/dist/mcp-server/prompts/definitions/pacing-performance-analysis.prompt.d.ts.map +1 -0
  45. package/dist/mcp-server/prompts/definitions/pacing-performance-analysis.prompt.js +204 -0
  46. package/dist/mcp-server/prompts/definitions/pacing-performance-analysis.prompt.js.map +1 -0
  47. package/dist/mcp-server/prompts/definitions/tool-schema-exploration.prompt.d.ts +4 -0
  48. package/dist/mcp-server/prompts/definitions/tool-schema-exploration.prompt.d.ts.map +1 -0
  49. package/dist/mcp-server/prompts/definitions/tool-schema-exploration.prompt.js +66 -0
  50. package/dist/mcp-server/prompts/definitions/tool-schema-exploration.prompt.js.map +1 -0
  51. package/dist/mcp-server/prompts/definitions/troubleshoot-report.prompt.d.ts +4 -0
  52. package/dist/mcp-server/prompts/definitions/troubleshoot-report.prompt.d.ts.map +1 -0
  53. package/dist/mcp-server/prompts/definitions/troubleshoot-report.prompt.js +179 -0
  54. package/dist/mcp-server/prompts/definitions/troubleshoot-report.prompt.js.map +1 -0
  55. package/dist/mcp-server/prompts/definitions/types.d.ts +15 -0
  56. package/dist/mcp-server/prompts/definitions/types.d.ts.map +1 -0
  57. package/dist/mcp-server/prompts/definitions/types.js +2 -0
  58. package/dist/mcp-server/prompts/definitions/types.js.map +1 -0
  59. package/dist/mcp-server/prompts/index.d.ts +6 -0
  60. package/dist/mcp-server/prompts/index.d.ts.map +1 -0
  61. package/dist/mcp-server/prompts/index.js +57 -0
  62. package/dist/mcp-server/prompts/index.js.map +1 -0
  63. package/dist/mcp-server/resources/definitions/compatibility-rules.resource.d.ts +3 -0
  64. package/dist/mcp-server/resources/definitions/compatibility-rules.resource.d.ts.map +1 -0
  65. package/dist/mcp-server/resources/definitions/compatibility-rules.resource.js +130 -0
  66. package/dist/mcp-server/resources/definitions/compatibility-rules.resource.js.map +1 -0
  67. package/dist/mcp-server/resources/definitions/filter-types.resource.d.ts +4 -0
  68. package/dist/mcp-server/resources/definitions/filter-types.resource.d.ts.map +1 -0
  69. package/dist/mcp-server/resources/definitions/filter-types.resource.js +198 -0
  70. package/dist/mcp-server/resources/definitions/filter-types.resource.js.map +1 -0
  71. package/dist/mcp-server/resources/definitions/index.d.ts +8 -0
  72. package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
  73. package/dist/mcp-server/resources/definitions/index.js +49 -0
  74. package/dist/mcp-server/resources/definitions/index.js.map +1 -0
  75. package/dist/mcp-server/resources/definitions/metric-types.resource.d.ts +4 -0
  76. package/dist/mcp-server/resources/definitions/metric-types.resource.d.ts.map +1 -0
  77. package/dist/mcp-server/resources/definitions/metric-types.resource.js +221 -0
  78. package/dist/mcp-server/resources/definitions/metric-types.resource.js.map +1 -0
  79. package/dist/mcp-server/resources/definitions/query-examples.resource.d.ts +169 -0
  80. package/dist/mcp-server/resources/definitions/query-examples.resource.d.ts.map +1 -0
  81. package/dist/mcp-server/resources/definitions/query-examples.resource.js +261 -0
  82. package/dist/mcp-server/resources/definitions/query-examples.resource.js.map +1 -0
  83. package/dist/mcp-server/resources/definitions/report-types.resource.d.ts +3 -0
  84. package/dist/mcp-server/resources/definitions/report-types.resource.d.ts.map +1 -0
  85. package/dist/mcp-server/resources/definitions/report-types.resource.js +198 -0
  86. package/dist/mcp-server/resources/definitions/report-types.resource.js.map +1 -0
  87. package/dist/mcp-server/resources/index.d.ts +3 -0
  88. package/dist/mcp-server/resources/index.d.ts.map +1 -0
  89. package/dist/mcp-server/resources/index.js +2 -0
  90. package/dist/mcp-server/resources/index.js.map +1 -0
  91. package/dist/mcp-server/resources/types.d.ts +16 -0
  92. package/dist/mcp-server/resources/types.d.ts.map +1 -0
  93. package/dist/mcp-server/resources/types.js +2 -0
  94. package/dist/mcp-server/resources/types.js.map +1 -0
  95. package/dist/mcp-server/server.d.ts +5 -0
  96. package/dist/mcp-server/server.d.ts.map +1 -0
  97. package/dist/mcp-server/server.js +115 -0
  98. package/dist/mcp-server/server.js.map +1 -0
  99. package/dist/mcp-server/tools/definitions/get-campaign-delivery.tool.d.ts +89 -0
  100. package/dist/mcp-server/tools/definitions/get-campaign-delivery.tool.d.ts.map +1 -0
  101. package/dist/mcp-server/tools/definitions/get-campaign-delivery.tool.js +128 -0
  102. package/dist/mcp-server/tools/definitions/get-campaign-delivery.tool.js.map +1 -0
  103. package/dist/mcp-server/tools/definitions/get-historical-metrics.tool.d.ts +155 -0
  104. package/dist/mcp-server/tools/definitions/get-historical-metrics.tool.d.ts.map +1 -0
  105. package/dist/mcp-server/tools/definitions/get-historical-metrics.tool.js +160 -0
  106. package/dist/mcp-server/tools/definitions/get-historical-metrics.tool.js.map +1 -0
  107. package/dist/mcp-server/tools/definitions/get-pacing-status.tool.d.ts +138 -0
  108. package/dist/mcp-server/tools/definitions/get-pacing-status.tool.d.ts.map +1 -0
  109. package/dist/mcp-server/tools/definitions/get-pacing-status.tool.js +171 -0
  110. package/dist/mcp-server/tools/definitions/get-pacing-status.tool.js.map +1 -0
  111. package/dist/mcp-server/tools/definitions/get-performance-metrics.tool.d.ts +122 -0
  112. package/dist/mcp-server/tools/definitions/get-performance-metrics.tool.d.ts.map +1 -0
  113. package/dist/mcp-server/tools/definitions/get-performance-metrics.tool.js +143 -0
  114. package/dist/mcp-server/tools/definitions/get-performance-metrics.tool.js.map +1 -0
  115. package/dist/mcp-server/tools/definitions/index.d.ts +8 -0
  116. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
  117. package/dist/mcp-server/tools/definitions/index.js +23 -0
  118. package/dist/mcp-server/tools/definitions/index.js.map +1 -0
  119. package/dist/mcp-server/tools/definitions/run-custom-query-async.tool.d.ts +4 -0
  120. package/dist/mcp-server/tools/definitions/run-custom-query-async.tool.d.ts.map +1 -0
  121. package/dist/mcp-server/tools/definitions/run-custom-query-async.tool.js +46 -0
  122. package/dist/mcp-server/tools/definitions/run-custom-query-async.tool.js.map +1 -0
  123. package/dist/mcp-server/tools/definitions/run-custom-query.tool.d.ts +186 -0
  124. package/dist/mcp-server/tools/definitions/run-custom-query.tool.d.ts.map +1 -0
  125. package/dist/mcp-server/tools/definitions/run-custom-query.tool.js +202 -0
  126. package/dist/mcp-server/tools/definitions/run-custom-query.tool.js.map +1 -0
  127. package/dist/mcp-server/tools/index.d.ts +2 -0
  128. package/dist/mcp-server/tools/index.d.ts.map +1 -0
  129. package/dist/mcp-server/tools/index.js +2 -0
  130. package/dist/mcp-server/tools/index.js.map +1 -0
  131. package/dist/mcp-server/tools/utils/query-validation.d.ts +44 -0
  132. package/dist/mcp-server/tools/utils/query-validation.d.ts.map +1 -0
  133. package/dist/mcp-server/tools/utils/query-validation.js +107 -0
  134. package/dist/mcp-server/tools/utils/query-validation.js.map +1 -0
  135. package/dist/mcp-server/tools/utils/resolve-session.d.ts +4 -0
  136. package/dist/mcp-server/tools/utils/resolve-session.d.ts.map +1 -0
  137. package/dist/mcp-server/tools/utils/resolve-session.js +6 -0
  138. package/dist/mcp-server/tools/utils/resolve-session.js.map +1 -0
  139. package/dist/mcp-server/transports/streamable-http-transport.d.ts +55 -0
  140. package/dist/mcp-server/transports/streamable-http-transport.d.ts.map +1 -0
  141. package/dist/mcp-server/transports/streamable-http-transport.js +55 -0
  142. package/dist/mcp-server/transports/streamable-http-transport.js.map +1 -0
  143. package/dist/services/bid-manager/BidManagerService.d.ts +68 -0
  144. package/dist/services/bid-manager/BidManagerService.d.ts.map +1 -0
  145. package/dist/services/bid-manager/BidManagerService.js +464 -0
  146. package/dist/services/bid-manager/BidManagerService.js.map +1 -0
  147. package/dist/services/bid-manager/auth-bridge.d.ts +6 -0
  148. package/dist/services/bid-manager/auth-bridge.d.ts.map +1 -0
  149. package/dist/services/bid-manager/auth-bridge.js +13 -0
  150. package/dist/services/bid-manager/auth-bridge.js.map +1 -0
  151. package/dist/services/bid-manager/client.d.ts +4 -0
  152. package/dist/services/bid-manager/client.d.ts.map +1 -0
  153. package/dist/services/bid-manager/client.js +2 -0
  154. package/dist/services/bid-manager/client.js.map +1 -0
  155. package/dist/services/bid-manager/index.d.ts +6 -0
  156. package/dist/services/bid-manager/index.d.ts.map +1 -0
  157. package/dist/services/bid-manager/index.js +4 -0
  158. package/dist/services/bid-manager/index.js.map +1 -0
  159. package/dist/services/bid-manager/report-parser.d.ts +26 -0
  160. package/dist/services/bid-manager/report-parser.d.ts.map +1 -0
  161. package/dist/services/bid-manager/report-parser.js +141 -0
  162. package/dist/services/bid-manager/report-parser.js.map +1 -0
  163. package/dist/services/bid-manager/types.d.ts +668 -0
  164. package/dist/services/bid-manager/types.d.ts.map +1 -0
  165. package/dist/services/bid-manager/types.js +256 -0
  166. package/dist/services/bid-manager/types.js.map +1 -0
  167. package/dist/services/session-services.d.ts +12 -0
  168. package/dist/services/session-services.d.ts.map +1 -0
  169. package/dist/services/session-services.js +18 -0
  170. package/dist/services/session-services.js.map +1 -0
  171. package/dist/types-global/bid-manager.d.ts +76 -0
  172. package/dist/types-global/bid-manager.d.ts.map +1 -0
  173. package/dist/types-global/bid-manager.js +2 -0
  174. package/dist/types-global/bid-manager.js.map +1 -0
  175. package/dist/types-global/index.d.ts +2 -0
  176. package/dist/types-global/index.d.ts.map +1 -0
  177. package/dist/types-global/index.js +2 -0
  178. package/dist/types-global/index.js.map +1 -0
  179. package/dist/types-global/mcp.d.ts +2 -0
  180. package/dist/types-global/mcp.d.ts.map +1 -0
  181. package/dist/types-global/mcp.js +2 -0
  182. package/dist/types-global/mcp.js.map +1 -0
  183. package/dist/utils/date.d.ts +2 -0
  184. package/dist/utils/date.d.ts.map +1 -0
  185. package/dist/utils/date.js +7 -0
  186. package/dist/utils/date.js.map +1 -0
  187. package/dist/utils/errors/bid-manager-errors.d.ts +57 -0
  188. package/dist/utils/errors/bid-manager-errors.d.ts.map +1 -0
  189. package/dist/utils/errors/bid-manager-errors.js +119 -0
  190. package/dist/utils/errors/bid-manager-errors.js.map +1 -0
  191. package/dist/utils/errors/index.d.ts +3 -0
  192. package/dist/utils/errors/index.d.ts.map +1 -0
  193. package/dist/utils/errors/index.js +3 -0
  194. package/dist/utils/errors/index.js.map +1 -0
  195. package/dist/utils/index.d.ts +4 -0
  196. package/dist/utils/index.d.ts.map +1 -0
  197. package/dist/utils/index.js +4 -0
  198. package/dist/utils/index.js.map +1 -0
  199. package/dist/utils/math.d.ts +9 -0
  200. package/dist/utils/math.d.ts.map +1 -0
  201. package/dist/utils/math.js +38 -0
  202. package/dist/utils/math.js.map +1 -0
  203. package/dist/utils/metrics.d.ts +21 -0
  204. package/dist/utils/metrics.d.ts.map +1 -0
  205. package/dist/utils/metrics.js +92 -0
  206. package/dist/utils/metrics.js.map +1 -0
  207. package/dist/utils/platform.d.ts +3 -0
  208. package/dist/utils/platform.d.ts.map +1 -0
  209. package/dist/utils/platform.js +5 -0
  210. package/dist/utils/platform.js.map +1 -0
  211. package/dist/utils/security/index.d.ts +2 -0
  212. package/dist/utils/security/index.d.ts.map +1 -0
  213. package/dist/utils/security/index.js +2 -0
  214. package/dist/utils/security/index.js.map +1 -0
  215. package/dist/utils/security/rate-limiter.d.ts +3 -0
  216. package/dist/utils/security/rate-limiter.d.ts.map +1 -0
  217. package/dist/utils/security/rate-limiter.js +5 -0
  218. package/dist/utils/security/rate-limiter.js.map +1 -0
  219. package/dist/utils/telemetry/index.d.ts +2 -0
  220. package/dist/utils/telemetry/index.d.ts.map +1 -0
  221. package/dist/utils/telemetry/index.js +2 -0
  222. package/dist/utils/telemetry/index.js.map +1 -0
  223. package/dist/utils/telemetry/tracing.d.ts +3 -0
  224. package/dist/utils/telemetry/tracing.d.ts.map +1 -0
  225. package/dist/utils/telemetry/tracing.js +4 -0
  226. package/dist/utils/telemetry/tracing.js.map +1 -0
  227. package/package.json +60 -0
@@ -0,0 +1,179 @@
1
+ export const troubleshootReportPrompt = {
2
+ name: "troubleshoot_report",
3
+ description: "Diagnostic workflow for debugging failed Bid Manager queries and common issues",
4
+ arguments: [
5
+ {
6
+ name: "errorMessage",
7
+ description: "The error message from the failed query",
8
+ required: false,
9
+ },
10
+ {
11
+ name: "queryType",
12
+ description: "Type of query that failed (e.g., 'dbm_run_custom_query', 'dbm_get_campaign_delivery')",
13
+ required: false,
14
+ },
15
+ ],
16
+ };
17
+ export function getTroubleshootReportMessage(args) {
18
+ const errorMessage = args?.errorMessage || "{error message}";
19
+ const queryType = args?.queryType || "dbm_run_custom_query";
20
+ return `# Troubleshooting Bid Manager Report Issues
21
+
22
+ ## Error Context
23
+ - **Tool:** ${queryType}
24
+ - **Error:** ${errorMessage}
25
+
26
+ ---
27
+
28
+ ## Step 1: Identify Error Category
29
+
30
+ ### Validation Errors
31
+ If you see "Unknown filter type" or "Unknown metric type":
32
+
33
+ 1. **Check spelling** - Filter/metric names are case-sensitive and exact
34
+ 2. **Verify availability** - Some filters/metrics only work with specific report types
35
+ 3. **Fetch references:**
36
+ - \`filter-types://all\` - All valid filter names
37
+ - \`metric-types://all\` - All valid metric names
38
+ - \`report-types://all\` - Report type compatibility
39
+
40
+ **Quick fix:** Set \`strictValidation: false\` to bypass validation and see API's native error
41
+
42
+ ---
43
+
44
+ ### API Errors
45
+ If you see "Report failed" or "Query execution failed":
46
+
47
+ 1. **Check date range:**
48
+ - Is the date range valid? (start before end)
49
+ - Is data available for that period?
50
+ - Try a recent preset like \`LAST_7_DAYS\`
51
+
52
+ 2. **Check advertiser ID:**
53
+ - Is the advertiser ID correct?
54
+ - Do you have access to this advertiser?
55
+
56
+ 3. **Reduce complexity:**
57
+ - Fewer groupBys = smaller report
58
+ - Start with 2-3 groupBys max
59
+ - Some combinations aren't supported
60
+
61
+ ---
62
+
63
+ ### No Data Returned
64
+ If the query succeeds but returns empty results:
65
+
66
+ 1. **Verify filters:**
67
+ - Is the advertiser ID correct?
68
+ - Are campaign/line item IDs valid?
69
+ - Check if filters are too restrictive
70
+
71
+ 2. **Check date range:**
72
+ - Is there activity in this period?
73
+ - Try \`LAST_30_DAYS\` for broader range
74
+
75
+ 3. **Verify metric availability:**
76
+ - Video metrics require video campaigns
77
+ - Conversion metrics require Floodlight setup
78
+ - Reach metrics require REACH report type
79
+
80
+ ---
81
+
82
+ ## Step 2: Common Issues by Report Type
83
+
84
+ ### STANDARD Reports
85
+ - Most flexible, supports most filters/metrics
86
+ - Conversion metrics may need Floodlight setup
87
+
88
+ ### YOUTUBE Reports
89
+ - Requires YouTube/TrueView campaigns
90
+ - Only supports YouTube-specific metrics
91
+ - Limited filter compatibility
92
+
93
+ ### FLOODLIGHT Reports
94
+ - Requires Floodlight activities
95
+ - Uses \`FILTER_FLOODLIGHT_ACTIVITY\` for grouping
96
+ - Limited to conversion-related metrics
97
+
98
+ ### REACH Reports
99
+ - Limited to reach/frequency metrics
100
+ - Fewer groupBy options supported
101
+ - May have data processing delays
102
+
103
+ ---
104
+
105
+ ## Step 3: Diagnostic Queries
106
+
107
+ ### Test Basic Connectivity
108
+ \`\`\`json
109
+ {
110
+ "reportType": "STANDARD",
111
+ "groupBys": ["FILTER_DATE"],
112
+ "metrics": ["METRIC_IMPRESSIONS"],
113
+ "filters": [
114
+ { "type": "FILTER_ADVERTISER", "value": "{advertiserId}" }
115
+ ],
116
+ "dateRange": { "preset": "LAST_7_DAYS" }
117
+ }
118
+ \`\`\`
119
+
120
+ ### Test Specific Campaign
121
+ \`\`\`json
122
+ {
123
+ "reportType": "STANDARD",
124
+ "groupBys": ["FILTER_MEDIA_PLAN"],
125
+ "metrics": ["METRIC_IMPRESSIONS", "METRIC_CLICKS"],
126
+ "filters": [
127
+ { "type": "FILTER_ADVERTISER", "value": "{advertiserId}" },
128
+ { "type": "FILTER_MEDIA_PLAN", "value": "{campaignId}" }
129
+ ],
130
+ "dateRange": { "preset": "LAST_30_DAYS" }
131
+ }
132
+ \`\`\`
133
+
134
+ ---
135
+
136
+ ## Step 4: Error Messages Reference
137
+
138
+ | Error | Cause | Solution |
139
+ |-------|-------|----------|
140
+ | "Unknown filter type: X" | Invalid filter name | Check \`filter-types://all\` |
141
+ | "Unknown metric type: X" | Invalid metric name | Check \`metric-types://all\` |
142
+ | "Unknown report type: X" | Invalid report type | Use STANDARD, YOUTUBE, etc. |
143
+ | "Unknown date range preset" | Invalid preset | Check \`report-types://all\` |
144
+ | "Report timed out" | Query too large | Reduce groupBys or date range |
145
+ | "No data available" | Empty results | Check filters, widen date range |
146
+ | "Access denied" | Permission issue | Verify advertiser access |
147
+ | "Invalid date range" | Date format error | Use YYYY-MM-DD format |
148
+
149
+ ---
150
+
151
+ ## Step 5: Escalation
152
+
153
+ If issues persist after troubleshooting:
154
+
155
+ 1. **Try pass-through mode:**
156
+ \`\`\`json
157
+ { "strictValidation": false }
158
+ \`\`\`
159
+ This sends the query directly to the API for native error messages.
160
+
161
+ 2. **Check API status:**
162
+ - Bid Manager API may have service issues
163
+ - Check Google Cloud Status Dashboard
164
+
165
+ 3. **Verify credentials:**
166
+ - OAuth tokens may need refresh
167
+ - Service account permissions may be insufficient
168
+
169
+ ---
170
+
171
+ ## Best Practices
172
+
173
+ 1. **Start simple** - Begin with few groupBys and expand
174
+ 2. **Use presets** - Date presets are more reliable than custom dates
175
+ 3. **Filter early** - Add specific filters to reduce data volume
176
+ 4. **Check examples** - Fetch \`query-examples://all\` for working templates
177
+ `;
178
+ }
179
+ //# sourceMappingURL=troubleshoot-report.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"troubleshoot-report.prompt.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/troubleshoot-report.prompt.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,wBAAwB,GAAW;IAC9C,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,gFAAgF;IAC7F,SAAS,EAAE;QACT;YACE,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,WAAW;YACjB,WAAW,EACT,uFAAuF;YACzF,QAAQ,EAAE,KAAK;SAChB;KACF;CACF,CAAC;AAEF,MAAM,UAAU,4BAA4B,CAAC,IAA6B;IACxE,MAAM,YAAY,GAAG,IAAI,EAAE,YAAY,IAAI,iBAAiB,CAAC;IAC7D,MAAM,SAAS,GAAG,IAAI,EAAE,SAAS,IAAI,sBAAsB,CAAC;IAE5D,OAAO;;;cAGK,SAAS;eACR,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyJ1B,CAAC;AACF,CAAC"}
@@ -0,0 +1,15 @@
1
+ export interface PromptArgument {
2
+ name: string;
3
+ description: string;
4
+ required?: boolean;
5
+ }
6
+ export interface Prompt {
7
+ name: string;
8
+ description: string;
9
+ arguments?: PromptArgument[];
10
+ }
11
+ export interface PromptDefinition {
12
+ prompt: Prompt;
13
+ generateMessage: (args?: Record<string, string>) => string;
14
+ }
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/types.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAKD,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;CAC9B;AAKD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC;CAC5D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export type { Prompt, PromptArgument, PromptDefinition } from "./definitions/types.js";
2
+ import type { PromptDefinition } from "./definitions/types.js";
3
+ export declare const promptRegistry: Map<string, PromptDefinition>;
4
+ export declare function getAllPrompts(): import("./index.js").Prompt[];
5
+ export declare function getPromptDefinition(name: string): PromptDefinition | undefined;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/prompts/index.ts"],"names":[],"mappings":"AAOA,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AA0BvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK/D,eAAO,MAAM,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CA2CvD,CAAC;AAKH,wBAAgB,aAAa,kCAE5B;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAE9E"}
@@ -0,0 +1,57 @@
1
+ import { customQueryWorkflowPrompt, getCustomQueryWorkflowMessage, } from "./definitions/custom-query-workflow.prompt.js";
2
+ import { troubleshootReportPrompt, getTroubleshootReportMessage, } from "./definitions/troubleshoot-report.prompt.js";
3
+ import { toolSchemaExplorationPrompt, getToolSchemaExplorationMessage, } from "./definitions/tool-schema-exploration.prompt.js";
4
+ import { pacingPerformanceAnalysisPrompt, getPacingPerformanceAnalysisMessage, } from "./definitions/pacing-performance-analysis.prompt.js";
5
+ import { crossPlatformPerformancePrompt, getCrossPlatformPerformanceMessage, } from "./definitions/cross-platform-performance.prompt.js";
6
+ import { crossPlatformCampaignSetupPrompt, getCrossPlatformCampaignSetupMessage, } from "./definitions/cross-platform-campaign-setup.prompt.js";
7
+ export const promptRegistry = new Map([
8
+ [
9
+ customQueryWorkflowPrompt.name,
10
+ {
11
+ prompt: customQueryWorkflowPrompt,
12
+ generateMessage: getCustomQueryWorkflowMessage,
13
+ },
14
+ ],
15
+ [
16
+ troubleshootReportPrompt.name,
17
+ {
18
+ prompt: troubleshootReportPrompt,
19
+ generateMessage: getTroubleshootReportMessage,
20
+ },
21
+ ],
22
+ [
23
+ toolSchemaExplorationPrompt.name,
24
+ {
25
+ prompt: toolSchemaExplorationPrompt,
26
+ generateMessage: getToolSchemaExplorationMessage,
27
+ },
28
+ ],
29
+ [
30
+ pacingPerformanceAnalysisPrompt.name,
31
+ {
32
+ prompt: pacingPerformanceAnalysisPrompt,
33
+ generateMessage: getPacingPerformanceAnalysisMessage,
34
+ },
35
+ ],
36
+ [
37
+ crossPlatformPerformancePrompt.name,
38
+ {
39
+ prompt: crossPlatformPerformancePrompt,
40
+ generateMessage: getCrossPlatformPerformanceMessage,
41
+ },
42
+ ],
43
+ [
44
+ crossPlatformCampaignSetupPrompt.name,
45
+ {
46
+ prompt: crossPlatformCampaignSetupPrompt,
47
+ generateMessage: getCrossPlatformCampaignSetupMessage,
48
+ },
49
+ ],
50
+ ]);
51
+ export function getAllPrompts() {
52
+ return Array.from(promptRegistry.values()).map((def) => def.prompt);
53
+ }
54
+ export function getPromptDefinition(name) {
55
+ return promptRegistry.get(name);
56
+ }
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp-server/prompts/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,+BAA+B,EAC/B,mCAAmC,GACpC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,8BAA8B,EAC9B,kCAAkC,GACnC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,gCAAgC,EAChC,oCAAoC,GACrC,MAAM,uDAAuD,CAAC;AAM/D,MAAM,CAAC,MAAM,cAAc,GAAkC,IAAI,GAAG,CAAC;IACnE;QACE,yBAAyB,CAAC,IAAI;QAC9B;YACE,MAAM,EAAE,yBAAyB;YACjC,eAAe,EAAE,6BAA6B;SAC/C;KACF;IACD;QACE,wBAAwB,CAAC,IAAI;QAC7B;YACE,MAAM,EAAE,wBAAwB;YAChC,eAAe,EAAE,4BAA4B;SAC9C;KACF;IACD;QACE,2BAA2B,CAAC,IAAI;QAChC;YACE,MAAM,EAAE,2BAA2B;YACnC,eAAe,EAAE,+BAA+B;SACjD;KACF;IACD;QACE,+BAA+B,CAAC,IAAI;QACpC;YACE,MAAM,EAAE,+BAA+B;YACvC,eAAe,EAAE,mCAAmC;SACrD;KACF;IACD;QACE,8BAA8B,CAAC,IAAI;QACnC;YACE,MAAM,EAAE,8BAA8B;YACtC,eAAe,EAAE,kCAAkC;SACpD;KACF;IACD;QACE,gCAAgC,CAAC,IAAI;QACrC;YACE,MAAM,EAAE,gCAAgC;YACxC,eAAe,EAAE,oCAAoC;SACtD;KACF;CACF,CAAC,CAAC;AAKH,MAAM,UAAU,aAAa;IAC3B,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Resource } from "../types.js";
2
+ export declare const compatibilityRulesResource: Resource;
3
+ //# sourceMappingURL=compatibility-rules.resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility-rules.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/compatibility-rules.resource.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AA0I5C,eAAO,MAAM,0BAA0B,EAAE,QAMxC,CAAC"}
@@ -0,0 +1,130 @@
1
+ import { REPORT_TYPE_RESTRICTIONS, INCOMPATIBLE_COMBINATIONS, GROUP_BY_ONLY_FILTERS, BEST_PRACTICES, } from "../../../generated/index.js";
2
+ function formatCompatibilityRulesMarkdown() {
3
+ return `# Bid Manager API Compatibility Rules
4
+
5
+ This resource documents known restrictions and requirements for using metrics and filters together in different report types.
6
+
7
+ **Important:** The Bid Manager API performs its own validation and will return HTTP 400 for invalid combinations. These rules are based on naming conventions and Google's documentation to help you avoid errors.
8
+
9
+ ---
10
+
11
+ ## Report Type Restrictions
12
+
13
+ The following metrics and filters are EXCLUSIVE to specific report types:
14
+
15
+ | Pattern | Required Report Type(s) | Description |
16
+ |---------|------------------------|-------------|
17
+ ${REPORT_TYPE_RESTRICTIONS.filter((r) => r.exclusive)
18
+ .map((rule) => {
19
+ const pattern = rule.metricsPattern?.source || rule.filtersPattern?.source || "N/A";
20
+ return `| \`${pattern}\` | ${rule.reportTypes.join(", ")} | ${rule.description} |`;
21
+ })
22
+ .join("\n")}
23
+
24
+ ### Key Rules
25
+
26
+ 1. **TrueView Metrics/Filters** (\`METRIC_TRUEVIEW*\`, \`FILTER_TRUEVIEW*\`)
27
+ - Only available in \`reportType: "YOUTUBE"\`
28
+ - Using these with STANDARD will cause an API error
29
+
30
+ 2. **Unique Reach Metrics** (\`METRIC_UNIQUE_REACH*\`)
31
+ - Only available in \`reportType: "REACH"\` or \`"UNIQUE_REACH_AUDIENCE"\`
32
+ - These metrics have privacy thresholds and may return incomplete data with granular dimensions
33
+
34
+ 3. **GRP Metrics/Filters** (\`METRIC_GRP*\`, \`FILTER_NIELSEN*\`)
35
+ - Only available in \`reportType: "GRP"\`
36
+
37
+ 4. **YouTube Programmatic Guaranteed** (\`*YOUTUBE_PROGRAMMATIC_GUARANTEED*\`)
38
+ - Only available in \`reportType: "YOUTUBE_PROGRAMMATIC_GUARANTEED"\`
39
+
40
+ 5. **Floodlight Metrics/Filters** (\`*FLOODLIGHT*\`)
41
+ - Available in both \`reportType: "STANDARD"\` and \`"FLOODLIGHT"\`
42
+
43
+ ---
44
+
45
+ ## GroupBy-Only Filters
46
+
47
+ These filters can ONLY be used in the \`groupBys\` array, NOT in the \`filters\` array:
48
+
49
+ ${GROUP_BY_ONLY_FILTERS.map((f) => `- \`${f}\``).join("\n")}
50
+
51
+ Using these as filters (instead of groupBys) will cause an API error.
52
+
53
+ ---
54
+
55
+ ## Known Incompatible Combinations
56
+
57
+ ${INCOMPATIBLE_COMBINATIONS.map((combo) => `### ${combo.description}
58
+
59
+ ${combo.incompatibleItems.metrics ? `**Affected metrics:**\n${combo.incompatibleItems.metrics.map((m) => `- \`${m}\``).join("\n")}` : ""}
60
+
61
+ **Reason:** ${combo.reason}
62
+ `).join("\n")}
63
+
64
+ ---
65
+
66
+ ## Best Practices
67
+
68
+ ${BEST_PRACTICES.map((bp, i) => `${i + 1}. ${bp}`).join("\n")}
69
+
70
+ ---
71
+
72
+ ## Validation Workflow
73
+
74
+ When building a query, validate your configuration in this order:
75
+
76
+ 1. **Check Report Type Compatibility**
77
+ - Ensure all metrics match the selected report type
78
+ - Ensure all filters match the selected report type
79
+
80
+ 2. **Check Filter Usage**
81
+ - Time-based dimensions (DATE, WEEK, etc.) must be in \`groupBys\`, not \`filters\`
82
+ - Entity filters (ADVERTISER, CAMPAIGN) can be in either
83
+
84
+ 3. **Test in DV360 UI First**
85
+ - Build the report in the Display & Video 360 interface
86
+ - Use "Show incompatible" toggle to verify combinations
87
+ - Export the configuration once validated
88
+
89
+ ---
90
+
91
+ ## Example: Validating a Query
92
+
93
+ \`\`\`json
94
+ {
95
+ "reportType": "YOUTUBE",
96
+ "groupBys": ["FILTER_DATE", "FILTER_LINE_ITEM"],
97
+ "metrics": [
98
+ "METRIC_TRUEVIEW_VIEWS", // ✓ YOUTUBE-specific
99
+ "METRIC_TRUEVIEW_VIEW_RATE", // ✓ YOUTUBE-specific
100
+ "METRIC_IMPRESSIONS" // ✓ General metric
101
+ ],
102
+ "filters": [
103
+ { "type": "FILTER_ADVERTISER", "value": "123456" } // ✓ General filter
104
+ ]
105
+ }
106
+ \`\`\`
107
+
108
+ This query is valid because:
109
+ - TrueView metrics are used with YOUTUBE report type
110
+ - FILTER_DATE is in groupBys (not filters)
111
+ - General metrics/filters work with any report type
112
+
113
+ ---
114
+
115
+ ## Related Resources
116
+
117
+ - \`metric-types://all\` - Complete metric reference with report type compatibility
118
+ - \`filter-types://all\` - Complete filter reference with report type compatibility
119
+ - \`report-types://all\` - Report type reference with compatible metrics/filters lists
120
+ - \`query-examples://all\` - Example queries for common use cases
121
+ `;
122
+ }
123
+ export const compatibilityRulesResource = {
124
+ uri: "compatibility-rules://all",
125
+ name: "Bid Manager Compatibility Rules",
126
+ description: "Detailed compatibility rules for metrics and filters across report types",
127
+ mimeType: "text/markdown",
128
+ getContent: () => formatCompatibilityRulesMarkdown(),
129
+ };
130
+ //# sourceMappingURL=compatibility-rules.resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility-rules.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definit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E,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqD5D,CAAC;AACF,CAAC;AAKD,MAAM,CAAC,MAAM,0BAA0B,GAAa;IAClD,GAAG,EAAE,2BAA2B;IAChC,IAAI,EAAE,iCAAiC;IACvC,WAAW,EAAE,0EAA0E;IACvF,QAAQ,EAAE,eAAe;IACzB,UAAU,EAAE,GAAG,EAAE,CAAC,gCAAgC,EAAE;CACrD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Resource } from "../types.js";
2
+ export declare const filterTypesResource: Resource;
3
+ export declare const filterTypeCategoryResources: Resource[];
4
+ //# sourceMappingURL=filter-types.resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-types.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/filter-types.resource.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAiO5C,eAAO,MAAM,mBAAmB,EAAE,QASjC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,EAM/C,CAAC"}
@@ -0,0 +1,198 @@
1
+ import { FILTER_METADATA, FILTER_CATEGORIES, } from "../../../generated/index.js";
2
+ let cachedFiltersMarkdown;
3
+ const cachedCategoryMarkdown = new Map();
4
+ function toCategorySlug(category) {
5
+ return category
6
+ .toLowerCase()
7
+ .replace(/[^a-z0-9]+/g, "-")
8
+ .replace(/(^-|-$)/g, "");
9
+ }
10
+ function formatFiltersMarkdown() {
11
+ const byCategory = new Map();
12
+ const byReportType = new Map();
13
+ for (const [filter, meta] of Object.entries(FILTER_METADATA)) {
14
+ const existing = byCategory.get(meta.category) || [];
15
+ existing.push([filter, meta]);
16
+ byCategory.set(meta.category, existing);
17
+ if (meta.reportTypes && meta.reportTypes.length < 3) {
18
+ for (const rt of meta.reportTypes) {
19
+ const rtExisting = byReportType.get(rt) || [];
20
+ rtExisting.push([filter, meta]);
21
+ byReportType.set(rt, rtExisting);
22
+ }
23
+ }
24
+ }
25
+ const totalFilters = Object.keys(FILTER_METADATA).length;
26
+ let markdown = `# Bid Manager API Filter/Dimension Types Reference
27
+
28
+ This resource provides a complete reference of all ${totalFilters} available filter and dimension types for Bid Manager API queries.
29
+
30
+ ## Usage
31
+
32
+ Filters are used in two ways:
33
+ 1. **In \`filters\` array**: To restrict data to specific values (e.g., filter by advertiser ID)
34
+ 2. **In \`groupBys\` array**: To break down data by dimension (e.g., daily breakdown)
35
+
36
+ **Important:** Not all filters are available in all report types. Check the "Report Types" column to ensure compatibility.
37
+
38
+ ## Categories
39
+
40
+ ${FILTER_CATEGORIES.map((cat) => `- ${cat}`).join("\n")}
41
+
42
+ ---
43
+
44
+ ## Report Type-Specific Filters
45
+
46
+ Some filters are ONLY available in specific report types:
47
+
48
+ ### YOUTUBE-Only Filters
49
+ These TrueView filters require \`reportType: "YOUTUBE"\`:
50
+ ${Array.from(byReportType.get("YOUTUBE") || [])
51
+ .map(([f]) => `- \`${f}\``)
52
+ .join("\n") || "- None currently defined"}
53
+
54
+ ### GRP-Only Filters
55
+ These Nielsen filters require \`reportType: "GRP"\`:
56
+ ${Array.from(byReportType.get("GRP") || [])
57
+ .map(([f]) => `- \`${f}\``)
58
+ .join("\n") || "- None currently defined"}
59
+
60
+ ### YOUTUBE_PROGRAMMATIC_GUARANTEED-Only Filters
61
+ These filters require \`reportType: "YOUTUBE_PROGRAMMATIC_GUARANTEED"\`:
62
+ ${Array.from(byReportType.get("YOUTUBE_PROGRAMMATIC_GUARANTEED") || [])
63
+ .map(([f]) => `- \`${f}\``)
64
+ .join("\n") || "- None currently defined"}
65
+
66
+ ---
67
+
68
+ `;
69
+ const sortedCategories = Array.from(byCategory.keys()).sort();
70
+ for (const category of sortedCategories) {
71
+ const filters = byCategory.get(category);
72
+ markdown += `## ${category} Filters (${filters.length})\n\n`;
73
+ markdown += "| Filter | Display Name | Report Types | Usage |\n";
74
+ markdown += "|--------|--------------|--------------|-------|\n";
75
+ filters.sort((a, b) => a[0].localeCompare(b[0]));
76
+ for (const [filter, meta] of filters) {
77
+ const usageStr = meta.usage.join(", ");
78
+ const reportTypes = meta.reportTypes?.join(", ") || "All";
79
+ markdown += `| \`${filter}\` | ${meta.displayName} | ${reportTypes} | ${usageStr} |\n`;
80
+ }
81
+ markdown += "\n";
82
+ }
83
+ markdown += `---
84
+
85
+ ## Common Filter Combinations
86
+
87
+ ### Daily Delivery by Campaign
88
+ \`\`\`json
89
+ {
90
+ "groupBys": ["FILTER_DATE", "FILTER_MEDIA_PLAN"],
91
+ "filters": [
92
+ { "type": "FILTER_ADVERTISER", "value": "123456" }
93
+ ]
94
+ }
95
+ \`\`\`
96
+
97
+ ### Device Type Breakdown
98
+ \`\`\`json
99
+ {
100
+ "groupBys": ["FILTER_DEVICE_TYPE"],
101
+ "filters": [
102
+ { "type": "FILTER_ADVERTISER", "value": "123456" },
103
+ { "type": "FILTER_MEDIA_PLAN", "value": "789012" }
104
+ ]
105
+ }
106
+ \`\`\`
107
+
108
+ ### Geographic Performance
109
+ \`\`\`json
110
+ {
111
+ "groupBys": ["FILTER_COUNTRY", "FILTER_REGION"],
112
+ "filters": [
113
+ { "type": "FILTER_ADVERTISER", "value": "123456" }
114
+ ]
115
+ }
116
+ \`\`\`
117
+
118
+ ### Line Item Performance
119
+ \`\`\`json
120
+ {
121
+ "groupBys": ["FILTER_LINE_ITEM"],
122
+ "filters": [
123
+ { "type": "FILTER_ADVERTISER", "value": "123456" },
124
+ { "type": "FILTER_MEDIA_PLAN", "value": "789012" }
125
+ ]
126
+ }
127
+ \`\`\`
128
+
129
+ ### Time of Day Analysis
130
+ \`\`\`json
131
+ {
132
+ "groupBys": ["FILTER_TIME_OF_DAY", "FILTER_DAY_OF_WEEK"],
133
+ "filters": [
134
+ { "type": "FILTER_ADVERTISER", "value": "123456" }
135
+ ]
136
+ }
137
+ \`\`\`
138
+
139
+ ### Creative Performance
140
+ \`\`\`json
141
+ {
142
+ "groupBys": ["FILTER_CREATIVE", "FILTER_CREATIVE_SIZE"],
143
+ "filters": [
144
+ { "type": "FILTER_ADVERTISER", "value": "123456" },
145
+ { "type": "FILTER_LINE_ITEM", "value": "345678" }
146
+ ]
147
+ }
148
+ \`\`\`
149
+ `;
150
+ return markdown;
151
+ }
152
+ function formatFiltersCategoryMarkdown(category) {
153
+ const cacheKey = toCategorySlug(category);
154
+ const cached = cachedCategoryMarkdown.get(cacheKey);
155
+ if (cached) {
156
+ return cached;
157
+ }
158
+ const filters = Object.entries(FILTER_METADATA)
159
+ .filter(([, meta]) => meta.category === category)
160
+ .sort((a, b) => a[0].localeCompare(b[0]));
161
+ let markdown = `# ${category} Filter Types
162
+
163
+ This resource contains only \`${category}\` filters from the full \`filter-types://all\` reference.
164
+
165
+ | Filter | Display Name | Report Types | Usage |
166
+ |--------|--------------|--------------|-------|
167
+ `;
168
+ for (const [filter, meta] of filters) {
169
+ const usageStr = meta.usage.join(", ");
170
+ const reportTypes = meta.reportTypes?.join(", ") || "All";
171
+ markdown += `| \`${filter}\` | ${meta.displayName} | ${reportTypes} | ${usageStr} |\n`;
172
+ }
173
+ markdown += `
174
+ ---
175
+
176
+ Need the full catalog? Use \`filter-types://all\`.
177
+ `;
178
+ cachedCategoryMarkdown.set(cacheKey, markdown);
179
+ return markdown;
180
+ }
181
+ export const filterTypesResource = {
182
+ uri: "filter-types://all",
183
+ name: "Bid Manager Filter/Dimension Types",
184
+ description: `Complete reference of all ${Object.keys(FILTER_METADATA).length} available Bid Manager API filters and dimensions`,
185
+ mimeType: "text/markdown",
186
+ getContent: () => {
187
+ cachedFiltersMarkdown ??= formatFiltersMarkdown();
188
+ return cachedFiltersMarkdown;
189
+ },
190
+ };
191
+ export const filterTypeCategoryResources = FILTER_CATEGORIES.map((category) => ({
192
+ uri: `filter-types://category/${toCategorySlug(category)}`,
193
+ name: `Bid Manager Filter Types (${category})`,
194
+ description: `Filter/dimension reference for ${category} category`,
195
+ mimeType: "text/markdown",
196
+ getContent: () => formatFiltersCategoryMarkdown(category),
197
+ }));
198
+ //# sourceMappingURL=filter-types.resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-types.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/filter-types.resource.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,eAAe,EACf,iBAAiB,GAGlB,MAAM,6BAA6B,CAAC;AAErC,IAAI,qBAAyC,CAAC;AAC9C,MAAM,sBAAsB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEzD,SAAS,cAAc,CAAC,QAAgB;IACtC,OAAO,QAAQ;SACZ,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAKD,SAAS,qBAAqB;IAC5B,MAAM,UAAU,GAAG,IAAI,GAAG,EAA+C,CAAC;IAC1E,MAAM,YAAY,GAAG,IAAI,GAAG,EAA+C,CAAC;IAG5E,KAAK,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAmC,EAAE,CAAC;QAE/F,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACrD,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;QAC9B,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAGxC,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAEpD,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBAClC,MAAM,UAAU,GAAG,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,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AG,EAAE,2BAA2B,cAAc,CAAC,QAAQ,CAAC,EAAE;IAC1D,IAAI,EAAE,6BAA6B,QAAQ,GAAG;IAC9C,WAAW,EAAE,kCAAkC,QAAQ,WAAW;IAClE,QAAQ,EAAE,eAAe;IACzB,UAAU,EAAE,GAAG,EAAE,CAAC,6BAA6B,CAAC,QAAQ,CAAC;CAC1D,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { metricTypesResource, metricTypeCategoryResources } from "./metric-types.resource.js";
2
+ export { filterTypesResource, filterTypeCategoryResources } from "./filter-types.resource.js";
3
+ export { queryExamplesResource, QUERY_EXAMPLES } from "./query-examples.resource.js";
4
+ export { reportTypesResource } from "./report-types.resource.js";
5
+ export { compatibilityRulesResource } from "./compatibility-rules.resource.js";
6
+ import type { Resource } from "../types.js";
7
+ export declare const allResources: Resource[];
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAS/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AA+B5C,eAAO,MAAM,YAAY,EAAE,QAAQ,EAUlC,CAAC"}