@capivv/mcp-server 0.5.39 → 0.5.40
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.
- package/dist/client.d.ts +23 -0
- package/dist/client.js +10 -0
- package/dist/tools/index.js +2 -0
- package/dist/tools/list-store-prices.d.ts +17 -0
- package/dist/tools/list-store-prices.js +23 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -47,6 +47,29 @@ export declare class CapivvClient {
|
|
|
47
47
|
base_currency?: string;
|
|
48
48
|
base_country_code?: string;
|
|
49
49
|
}): Promise<Product>;
|
|
50
|
+
/**
|
|
51
|
+
* V0.5.40 — issue #19. Read current per-territory prices from connected
|
|
52
|
+
* store(s) for a product. Returns `{ apple: [...], google: [...] }`
|
|
53
|
+
* plus `*_supported_for_product` flags so callers can distinguish
|
|
54
|
+
* "store says zero territories" from "this product type isn't read-
|
|
55
|
+
* supported yet."
|
|
56
|
+
*/
|
|
57
|
+
listStorePrices(productId: string): Promise<{
|
|
58
|
+
product_id: string;
|
|
59
|
+
apple_store_product_id?: string;
|
|
60
|
+
apple: Array<{
|
|
61
|
+
territory: string;
|
|
62
|
+
currency: string;
|
|
63
|
+
customer_price: string;
|
|
64
|
+
}>;
|
|
65
|
+
apple_supported_for_product: boolean;
|
|
66
|
+
google: Array<{
|
|
67
|
+
territory: string;
|
|
68
|
+
currency: string;
|
|
69
|
+
customer_price: string;
|
|
70
|
+
}>;
|
|
71
|
+
google_supported_for_product: boolean;
|
|
72
|
+
}>;
|
|
50
73
|
deleteProduct(id: string): Promise<void>;
|
|
51
74
|
deleteRule(id: string): Promise<void>;
|
|
52
75
|
activateRule(id: string): Promise<Rule>;
|
package/dist/client.js
CHANGED
|
@@ -144,6 +144,16 @@ export class CapivvClient {
|
|
|
144
144
|
async updateProduct(id, data) {
|
|
145
145
|
return this.patch(`/dashboard/products/${encodeURIComponent(id)}`, data);
|
|
146
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* V0.5.40 — issue #19. Read current per-territory prices from connected
|
|
149
|
+
* store(s) for a product. Returns `{ apple: [...], google: [...] }`
|
|
150
|
+
* plus `*_supported_for_product` flags so callers can distinguish
|
|
151
|
+
* "store says zero territories" from "this product type isn't read-
|
|
152
|
+
* supported yet."
|
|
153
|
+
*/
|
|
154
|
+
async listStorePrices(productId) {
|
|
155
|
+
return this.get(`/dashboard/products/${encodeURIComponent(productId)}/store-prices`);
|
|
156
|
+
}
|
|
147
157
|
async deleteProduct(id) {
|
|
148
158
|
await this.delete(`/dashboard/products/${encodeURIComponent(id)}`);
|
|
149
159
|
}
|
package/dist/tools/index.js
CHANGED
|
@@ -48,6 +48,7 @@ import { registerSetCountryPriceOverrideTool } from './set-country-price-overrid
|
|
|
48
48
|
import { registerCreateExperimentTool } from './create-experiment.js';
|
|
49
49
|
import { registerUpdateExperimentTool } from './update-experiment.js';
|
|
50
50
|
import { registerUpdateVariantTool } from './update-variant.js';
|
|
51
|
+
import { registerListStorePricesTool } from './list-store-prices.js';
|
|
51
52
|
import { registerStartExperimentTool } from './start-experiment.js';
|
|
52
53
|
import { registerStopExperimentTool } from './stop-experiment.js';
|
|
53
54
|
import { registerGetExperimentSummaryTool } from './get-experiment-summary.js';
|
|
@@ -163,6 +164,7 @@ export function registerAllTools(server, client) {
|
|
|
163
164
|
registerCreateExperimentTool(server, client);
|
|
164
165
|
registerUpdateExperimentTool(server, client);
|
|
165
166
|
registerUpdateVariantTool(server, client);
|
|
167
|
+
registerListStorePricesTool(server, client);
|
|
166
168
|
registerStartExperimentTool(server, client);
|
|
167
169
|
registerStopExperimentTool(server, client);
|
|
168
170
|
registerGetExperimentSummaryTool(server, client);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { CapivvClient } from '../client.js';
|
|
3
|
+
/**
|
|
4
|
+
* V0.5.40 — issue #19. Read the CURRENT per-territory prices Apple has
|
|
5
|
+
* on file for a product so the operator can diff against a pricing
|
|
6
|
+
* strategy's proposed output before calling `push_prices_to_stores`.
|
|
7
|
+
*
|
|
8
|
+
* Subscriptions only in v0.5.40 (IAPs walk a different price-schedule
|
|
9
|
+
* graph, filed as followup). Google read parity is also followup.
|
|
10
|
+
*
|
|
11
|
+
* Pair this with `capivv_preview_pricing` to see proposed vs live in
|
|
12
|
+
* one operator session. Note: the operator-facing "Apple is currently
|
|
13
|
+
* selling X for Y" data lives at this surface; `get_product`'s new
|
|
14
|
+
* v0.5.40 `base_*` fields are the *capivv-side* base, not Apple's
|
|
15
|
+
* live tier.
|
|
16
|
+
*/
|
|
17
|
+
export declare function registerListStorePricesTool(server: McpServer, client: CapivvClient): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* V0.5.40 — issue #19. Read the CURRENT per-territory prices Apple has
|
|
4
|
+
* on file for a product so the operator can diff against a pricing
|
|
5
|
+
* strategy's proposed output before calling `push_prices_to_stores`.
|
|
6
|
+
*
|
|
7
|
+
* Subscriptions only in v0.5.40 (IAPs walk a different price-schedule
|
|
8
|
+
* graph, filed as followup). Google read parity is also followup.
|
|
9
|
+
*
|
|
10
|
+
* Pair this with `capivv_preview_pricing` to see proposed vs live in
|
|
11
|
+
* one operator session. Note: the operator-facing "Apple is currently
|
|
12
|
+
* selling X for Y" data lives at this surface; `get_product`'s new
|
|
13
|
+
* v0.5.40 `base_*` fields are the *capivv-side* base, not Apple's
|
|
14
|
+
* live tier.
|
|
15
|
+
*/
|
|
16
|
+
export function registerListStorePricesTool(server, client) {
|
|
17
|
+
server.tool('capivv_list_store_prices', "Read the current per-country prices Apple (and eventually Google) has on file for a product. Subscriptions only in this release — IAPs and Google return empty arrays with the *_supported_for_product flags = false. Use this to diff proposed pricing-strategy output against live store tiers before pushing.", {
|
|
18
|
+
product_id: z.string().uuid().describe('The capivv product ID'),
|
|
19
|
+
}, async ({ product_id }) => {
|
|
20
|
+
const result = await client.listStorePrices(product_id);
|
|
21
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
22
|
+
});
|
|
23
|
+
}
|