@frase/mcp-server 0.2.1 → 0.3.2
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/api-client.d.ts +3 -90
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +2 -214
- package/dist/api-client.js.map +1 -1
- package/dist/cache.d.ts +2 -49
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +2 -94
- package/dist/cache.js.map +1 -1
- package/dist/cli/config-writer.d.ts.map +1 -1
- package/dist/cli/config-writer.js +52 -7
- package/dist/cli/config-writer.js.map +1 -1
- package/dist/config.d.ts +3 -14
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -28
- package/dist/config.js.map +1 -1
- package/dist/formatter.d.ts +2 -44
- package/dist/formatter.d.ts.map +1 -1
- package/dist/formatter.js +2 -142
- package/dist/formatter.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/mcp-audit.d.ts +3 -0
- package/dist/lib/mcp-audit.d.ts.map +1 -0
- package/dist/lib/mcp-audit.js +95 -0
- package/dist/lib/mcp-audit.js.map +1 -0
- package/dist/mcpb-bundle.js +30072 -0
- package/dist/prompts/cms-publishing.d.ts +16 -0
- package/dist/prompts/cms-publishing.d.ts.map +1 -0
- package/dist/prompts/cms-publishing.js +84 -0
- package/dist/prompts/cms-publishing.js.map +1 -0
- package/dist/prompts/competitive-intelligence.d.ts +16 -0
- package/dist/prompts/competitive-intelligence.d.ts.map +1 -0
- package/dist/prompts/competitive-intelligence.js +78 -0
- package/dist/prompts/competitive-intelligence.js.map +1 -0
- package/dist/prompts/content-governance.d.ts +16 -0
- package/dist/prompts/content-governance.d.ts.map +1 -0
- package/dist/prompts/content-governance.js +113 -0
- package/dist/prompts/content-governance.js.map +1 -0
- package/dist/prompts/content-pipeline.d.ts.map +1 -1
- package/dist/prompts/content-pipeline.js +10 -18
- package/dist/prompts/content-pipeline.js.map +1 -1
- package/dist/prompts/create-seo-article.d.ts.map +1 -1
- package/dist/prompts/create-seo-article.js +17 -42
- package/dist/prompts/create-seo-article.js.map +1 -1
- package/dist/prompts/geo-optimization.d.ts +17 -0
- package/dist/prompts/geo-optimization.d.ts.map +1 -0
- package/dist/prompts/geo-optimization.js +79 -0
- package/dist/prompts/geo-optimization.js.map +1 -0
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +15 -0
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/keyword-research.d.ts.map +1 -1
- package/dist/prompts/keyword-research.js +20 -31
- package/dist/prompts/keyword-research.js.map +1 -1
- package/dist/resources/briefs.d.ts.map +1 -1
- package/dist/resources/briefs.js +12 -6
- package/dist/resources/briefs.js.map +1 -1
- package/dist/tools/ai-visibility.d.ts.map +1 -1
- package/dist/tools/ai-visibility.js +67 -12
- package/dist/tools/ai-visibility.js.map +1 -1
- package/dist/tools/analytics.d.ts.map +1 -1
- package/dist/tools/analytics.js +9 -4
- package/dist/tools/analytics.js.map +1 -1
- package/dist/tools/atomization.d.ts +8 -0
- package/dist/tools/atomization.d.ts.map +1 -0
- package/dist/tools/atomization.js +172 -0
- package/dist/tools/atomization.js.map +1 -0
- package/dist/tools/audits.d.ts +8 -5
- package/dist/tools/audits.d.ts.map +1 -1
- package/dist/tools/audits.js +113 -22
- package/dist/tools/audits.js.map +1 -1
- package/dist/tools/briefs.d.ts +40 -145
- package/dist/tools/briefs.d.ts.map +1 -1
- package/dist/tools/briefs.js +212 -163
- package/dist/tools/briefs.js.map +1 -1
- package/dist/tools/clusters.d.ts +9 -0
- package/dist/tools/clusters.d.ts.map +1 -0
- package/dist/tools/clusters.js +166 -0
- package/dist/tools/clusters.js.map +1 -0
- package/dist/tools/cms-connections.d.ts +7 -0
- package/dist/tools/cms-connections.d.ts.map +1 -0
- package/dist/tools/cms-connections.js +96 -0
- package/dist/tools/cms-connections.js.map +1 -0
- package/dist/tools/competitive-analysis.js +2 -2
- package/dist/tools/competitive-analysis.js.map +1 -1
- package/dist/tools/content.d.ts +36 -8
- package/dist/tools/content.d.ts.map +1 -1
- package/dist/tools/content.js +415 -30
- package/dist/tools/content.js.map +1 -1
- package/dist/tools/discover.d.ts +15 -0
- package/dist/tools/discover.d.ts.map +1 -0
- package/dist/tools/discover.js +180 -0
- package/dist/tools/discover.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +32 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/jobs.d.ts +2 -2
- package/dist/tools/opportunities.d.ts +11 -0
- package/dist/tools/opportunities.d.ts.map +1 -0
- package/dist/tools/opportunities.js +122 -0
- package/dist/tools/opportunities.js.map +1 -0
- package/dist/tools/optimizations.d.ts +4 -0
- package/dist/tools/optimizations.d.ts.map +1 -1
- package/dist/tools/optimizations.js +359 -26
- package/dist/tools/optimizations.js.map +1 -1
- package/dist/tools/publish.d.ts +3 -3
- package/dist/tools/publish.js +6 -6
- package/dist/tools/publish.js.map +1 -1
- package/dist/tools/research.d.ts +18 -6
- package/dist/tools/research.d.ts.map +1 -1
- package/dist/tools/research.js +210 -19
- package/dist/tools/research.js.map +1 -1
- package/dist/tools/rules.d.ts +76 -0
- package/dist/tools/rules.d.ts.map +1 -1
- package/dist/tools/rules.js +355 -12
- package/dist/tools/rules.js.map +1 -1
- package/dist/tools/serp.d.ts.map +1 -1
- package/dist/tools/serp.js +30 -18
- package/dist/tools/serp.js.map +1 -1
- package/dist/tools/site-health.d.ts +7 -0
- package/dist/tools/site-health.d.ts.map +1 -0
- package/dist/tools/site-health.js +120 -0
- package/dist/tools/site-health.js.map +1 -0
- package/dist/tools/templates.js +5 -5
- package/dist/tools/templates.js.map +1 -1
- package/dist/tools/webhooks.d.ts.map +1 -1
- package/dist/tools/webhooks.js +24 -3
- package/dist/tools/webhooks.js.map +1 -1
- package/dist/types.d.ts +2 -180
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/package.json +30 -14
- package/server.json +4 -4
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GEO Optimization Prompt
|
|
3
|
+
*
|
|
4
|
+
* Optimize content for AI engine citation (GEO/AEO).
|
|
5
|
+
* Analyzes content quotability, structures for AI extraction,
|
|
6
|
+
* and tracks before/after AI visibility changes.
|
|
7
|
+
*/
|
|
8
|
+
export const geoOptimizationPrompt = {
|
|
9
|
+
name: "geo_optimization",
|
|
10
|
+
description: "Optimize content for AI engine citation (GEO/AEO). Analyzes quotability, restructures content for AI extraction, and tracks visibility changes across ChatGPT, Perplexity, Claude, Google AI Overviews, Copilot, Grok, DeepSeek, and Gemini.",
|
|
11
|
+
arguments: [
|
|
12
|
+
{
|
|
13
|
+
name: "content_id",
|
|
14
|
+
description: "Content ID to optimize for GEO (required)",
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "site_id",
|
|
19
|
+
description: "Site ID for AI visibility tracking (required)",
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "target_brand",
|
|
24
|
+
description: "Brand name to track in AI citations (required)",
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
export function getGeoOptimizationMessages(args) {
|
|
30
|
+
const contentId = args.content_id || "";
|
|
31
|
+
const siteId = args.site_id || "";
|
|
32
|
+
const targetBrand = args.target_brand || "";
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
role: "user",
|
|
36
|
+
content: {
|
|
37
|
+
type: "text",
|
|
38
|
+
text: `Optimize content "${contentId}" for AI engine citation (GEO/AEO). Make it quotable by ChatGPT, Perplexity, Claude, Google AI Overviews, Copilot, Grok, DeepSeek, and Gemini.
|
|
39
|
+
|
|
40
|
+
**Configuration:**
|
|
41
|
+
- Content ID: ${contentId}
|
|
42
|
+
- Site ID: ${siteId}
|
|
43
|
+
- Brand: ${targetBrand}
|
|
44
|
+
|
|
45
|
+
**Execute these steps:**
|
|
46
|
+
|
|
47
|
+
**Step 1 — Baseline AI Visibility:** Use get_ai_visibility with site_id "${siteId}" to get current visibility metrics. Note which platforms currently cite this content and which don't.
|
|
48
|
+
|
|
49
|
+
**Step 2 — Get Content:** Use get_content with content_id "${contentId}" to review the current content structure.
|
|
50
|
+
|
|
51
|
+
**Step 3 — Run Optimization:** Use start_optimization with content_id "${contentId}". Wait for completion using get_job_status, then use get_optimization to review both SEO and GEO scores and suggestions.
|
|
52
|
+
|
|
53
|
+
**Step 4 — Apply GEO-Specific Improvements:** Focus on suggestions that improve AI quotability:
|
|
54
|
+
- Add structured claims with citations (e.g., "According to [source], X increases Y by Z%")
|
|
55
|
+
- Include statistics and data points with sources
|
|
56
|
+
- Write clear, quotable one-sentence statements
|
|
57
|
+
- Add FAQ sections with concise 2-3 sentence answers
|
|
58
|
+
- Use clear H2/H3 headings that match common queries
|
|
59
|
+
- Add comparison tables for "vs" queries
|
|
60
|
+
- Include a summary/TL;DR section
|
|
61
|
+
Apply high-priority suggestions using apply_optimization.
|
|
62
|
+
|
|
63
|
+
**Step 5 — Re-Score:** Use start_optimization again to verify the GEO score improved. Target GEO score >= 70. Repeat optimization up to 2 more times if below target.
|
|
64
|
+
|
|
65
|
+
**Step 6 — Set Up Monitoring:** Use create_prompt with a natural question about this content's topic and target_brand "${targetBrand}". This tracks future AI citations.
|
|
66
|
+
|
|
67
|
+
**Step 7 — Check AI Insights:** Use get_insights for actionable recommendations and get_competitors to see who currently gets cited for related queries.
|
|
68
|
+
|
|
69
|
+
**Provide a summary report:**
|
|
70
|
+
- Before/after GEO score
|
|
71
|
+
- Key GEO improvements applied
|
|
72
|
+
- Citation gap diagnosis (content, authority, entity, or citation gap)
|
|
73
|
+
- AI visibility monitoring status
|
|
74
|
+
- Recommended next steps`,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=geo-optimization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geo-optimization.js","sourceRoot":"","sources":["../../src/prompts/geo-optimization.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,CAAC,MAAM,qBAAqB,GAAwB;IACxD,IAAI,EAAE,kBAAkB;IACxB,WAAW,EACT,8OAA8O;IAChP,SAAS,EAAE;QACT;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC;AAEF,MAAM,UAAU,0BAA0B,CAAC,IAA4B;IAIrE,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC;IACxC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;IAClC,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;IAE5C,OAAO;QACL;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,qBAAqB,SAAS;;;gBAG5B,SAAS;aACZ,MAAM;WACR,WAAW;;;;2EAIqD,MAAM;;6DAEpB,SAAS;;yEAEG,SAAS;;;;;;;;;;;;;;yHAcuC,WAAW;;;;;;;;;yBAS3G;aAClB;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA+DvD,eAAO,MAAM,WAAW,EAAE,mBAAmB,EAc5C,CAAC;AA+BF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAE7E;AAMD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,KAAK,CAAC;IACP,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC,CAAC,CAOD;AAMD,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -12,6 +12,11 @@ import { competitorAnalysisPrompt, getCompetitorAnalysisMessages, } from "./comp
|
|
|
12
12
|
import { contentAuditPrompt, getContentAuditMessages, } from "./content-audit.js";
|
|
13
13
|
import { contentPipelinePrompt, getContentPipelineMessages, } from "./content-pipeline.js";
|
|
14
14
|
import { contentWatchdogPrompt, getContentWatchdogMessages, } from "./content-watchdog.js";
|
|
15
|
+
// New prompts (GEO/AEO, Competitive, Governance, Publishing)
|
|
16
|
+
import { geoOptimizationPrompt, getGeoOptimizationMessages, } from "./geo-optimization.js";
|
|
17
|
+
import { competitiveIntelligencePrompt, getCompetitiveIntelligenceMessages, } from "./competitive-intelligence.js";
|
|
18
|
+
import { contentGovernancePrompt, getContentGovernanceMessages, } from "./content-governance.js";
|
|
19
|
+
import { cmsPublishingPrompt, getCmsPublishingMessages, } from "./cms-publishing.js";
|
|
15
20
|
// ============================================
|
|
16
21
|
// All Prompts
|
|
17
22
|
// ============================================
|
|
@@ -23,6 +28,11 @@ export const ALL_PROMPTS = [
|
|
|
23
28
|
contentAuditPrompt,
|
|
24
29
|
contentPipelinePrompt,
|
|
25
30
|
contentWatchdogPrompt,
|
|
31
|
+
// New prompts
|
|
32
|
+
geoOptimizationPrompt,
|
|
33
|
+
competitiveIntelligencePrompt,
|
|
34
|
+
contentGovernancePrompt,
|
|
35
|
+
cmsPublishingPrompt,
|
|
26
36
|
];
|
|
27
37
|
const PROMPT_MESSAGE_GENERATORS = {
|
|
28
38
|
create_seo_article: getCreateSeoArticleMessages,
|
|
@@ -32,6 +42,11 @@ const PROMPT_MESSAGE_GENERATORS = {
|
|
|
32
42
|
content_audit: getContentAuditMessages,
|
|
33
43
|
content_pipeline: getContentPipelineMessages,
|
|
34
44
|
content_watchdog: getContentWatchdogMessages,
|
|
45
|
+
// New prompts
|
|
46
|
+
geo_optimization: getGeoOptimizationMessages,
|
|
47
|
+
competitive_intelligence: getCompetitiveIntelligenceMessages,
|
|
48
|
+
content_governance: getContentGovernanceMessages,
|
|
49
|
+
cms_publishing: getCmsPublishingMessages,
|
|
35
50
|
};
|
|
36
51
|
// ============================================
|
|
37
52
|
// Get Prompt by Name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,wBAAwB;AACxB,OAAO,EACL,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,qBAAqB,EACrB,0BA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":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"keyword-research.d.ts","sourceRoot":"","sources":["../../src/prompts/keyword-research.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,eAAO,MAAM,qBAAqB,EAAE,mBAgBnC,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC;IAC9E,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC,CAAC,CAoCD"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export const keywordResearchPrompt = {
|
|
10
10
|
name: "keyword_research",
|
|
11
|
-
description: "Research keywords for a topic.
|
|
11
|
+
description: "Research keywords for a topic. Runs full research including keyword extraction, SERP analysis, content gaps, and search intent classification.",
|
|
12
12
|
arguments: [
|
|
13
13
|
{
|
|
14
14
|
name: "topic",
|
|
@@ -16,21 +16,15 @@ export const keywordResearchPrompt = {
|
|
|
16
16
|
required: true,
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
name: "
|
|
20
|
-
description: "
|
|
21
|
-
required:
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: "language",
|
|
25
|
-
description: "Two-letter language code (default: en)",
|
|
26
|
-
required: false,
|
|
19
|
+
name: "site_id",
|
|
20
|
+
description: "Site ID for brand context and localization (required). Use list_sites to find your site ID.",
|
|
21
|
+
required: true,
|
|
27
22
|
},
|
|
28
23
|
],
|
|
29
24
|
};
|
|
30
25
|
export function getKeywordResearchMessages(args) {
|
|
31
26
|
const topic = args.topic || "[topic]";
|
|
32
|
-
const
|
|
33
|
-
const language = args.language || "en";
|
|
27
|
+
const siteId = args.site_id || "";
|
|
34
28
|
return [
|
|
35
29
|
{
|
|
36
30
|
role: "user",
|
|
@@ -38,33 +32,28 @@ export function getKeywordResearchMessages(args) {
|
|
|
38
32
|
type: "text",
|
|
39
33
|
text: `Please help me research keywords for: "${topic}"
|
|
40
34
|
|
|
41
|
-
|
|
42
|
-
- Country: ${country}
|
|
43
|
-
- Language: ${language}
|
|
35
|
+
Site ID: ${siteId}
|
|
44
36
|
|
|
45
37
|
Please follow these steps:
|
|
46
38
|
|
|
47
|
-
1. **
|
|
48
|
-
- Current top-ranking content
|
|
49
|
-
- Featured snippets
|
|
50
|
-
- People Also Ask questions
|
|
51
|
-
- Related searches
|
|
52
|
-
|
|
53
|
-
2. **Get search intent** using get_search_intent to determine:
|
|
54
|
-
- Primary intent (informational, transactional, navigational)
|
|
55
|
-
- Recommended content type and format
|
|
39
|
+
1. **Research the topic** using start_research with query "${topic}" and site_id "${siteId}". Wait for completion using get_job_status. This runs keyword extraction, SERP analysis, content gaps, evidence gathering, and AI visibility analysis in parallel.
|
|
56
40
|
|
|
57
|
-
|
|
41
|
+
2. **Retrieve results** using get_research to see:
|
|
42
|
+
- Keywords with search volume, difficulty, and categories
|
|
43
|
+
- SERP competitors and their content structure
|
|
44
|
+
- Content gaps and opportunities
|
|
45
|
+
- Questions people ask about this topic
|
|
46
|
+
- Search intent analysis
|
|
58
47
|
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
- Recommended content angle
|
|
48
|
+
3. **Present your findings** including:
|
|
49
|
+
- Top keyword opportunities (sorted by volume and difficulty)
|
|
50
|
+
- Content gaps worth exploiting
|
|
51
|
+
- Search intent breakdown
|
|
52
|
+
- Recommended content angle based on the competitive landscape
|
|
64
53
|
|
|
65
|
-
|
|
54
|
+
4. **Suggest next steps** — offer to create a research-backed brief using create_brief with the research_session_id
|
|
66
55
|
|
|
67
|
-
Please start with the
|
|
56
|
+
Please start with the research.`,
|
|
68
57
|
},
|
|
69
58
|
},
|
|
70
59
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyword-research.js","sourceRoot":"","sources":["../../src/prompts/keyword-research.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,CAAC,MAAM,qBAAqB,GAAwB;IACxD,IAAI,EAAE,kBAAkB;IACxB,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"keyword-research.js","sourceRoot":"","sources":["../../src/prompts/keyword-research.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,CAAC,MAAM,qBAAqB,GAAwB;IACxD,IAAI,EAAE,kBAAkB;IACxB,WAAW,EACT,gJAAgJ;IAClJ,SAAS,EAAE;QACT;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,kDAAkD;YAC/D,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,6FAA6F;YAC1G,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC;AAEF,MAAM,UAAU,0BAA0B,CAAC,IAA4B;IAIrE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,SAAS,CAAC;IACtC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;IAElC,OAAO;QACL;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,0CAA0C,KAAK;;WAElD,MAAM;;;;6DAI4C,KAAK,kBAAkB,MAAM;;;;;;;;;;;;;;;;;gCAiB1D;aACzB;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"briefs.d.ts","sourceRoot":"","sources":["../../src/resources/briefs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,WAAW,EAIZ,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"briefs.d.ts","sourceRoot":"","sources":["../../src/resources/briefs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,WAAW,EAIZ,MAAM,aAAa,CAAC;AAgCrB,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAMlD,eAAO,MAAM,sBAAsB;;;;;GAOlC,CAAC;AAMF,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,aAAa,EAAE,CAAC,CAsC1B;AAMD,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,CAAC,CAWjB;AA6GD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD"}
|
package/dist/resources/briefs.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - frase://briefs/{id} - Individual brief with outline
|
|
7
7
|
*/
|
|
8
8
|
import { CACHE_TTL } from "../cache.js";
|
|
9
|
-
import { formatKeyValue, formatDate, formatStatus, truncate } from "../formatter.js";
|
|
9
|
+
import { formatKeyValue, formatDate, formatStatus, formatContentType, truncate } from "../formatter.js";
|
|
10
10
|
// ============================================
|
|
11
11
|
// Resource URIs
|
|
12
12
|
// ============================================
|
|
@@ -39,7 +39,7 @@ export async function listBriefResources(context) {
|
|
|
39
39
|
resources.push({
|
|
40
40
|
uri: `${BRIEF_URI_PREFIX}${brief.id}`,
|
|
41
41
|
name: truncate(brief.topic, 50),
|
|
42
|
-
description: `${formatStatus(brief.status)} - ${brief.content_type
|
|
42
|
+
description: `${formatStatus(brief.status)} - ${formatContentType(brief.content_type)}`,
|
|
43
43
|
mimeType: "text/markdown",
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -79,7 +79,7 @@ async function readBriefsList(context) {
|
|
|
79
79
|
markdown += `| Topic | Status | Type | Created |\n`;
|
|
80
80
|
markdown += `|-------|--------|------|--------|\n`;
|
|
81
81
|
for (const brief of response.data) {
|
|
82
|
-
markdown += `| ${truncate(brief.topic, 40)} | ${formatStatus(brief.status)} | ${brief.content_type
|
|
82
|
+
markdown += `| ${truncate(brief.topic, 40)} | ${formatStatus(brief.status)} | ${formatContentType(brief.content_type)} | ${formatDate(brief.created_at)} |\n`;
|
|
83
83
|
}
|
|
84
84
|
const { pagination } = response;
|
|
85
85
|
markdown += `\n**Showing ${response.data.length} of ${pagination.total} items**\n`;
|
|
@@ -95,15 +95,21 @@ async function readBriefDetails(briefId, context) {
|
|
|
95
95
|
markdown += formatKeyValue({
|
|
96
96
|
ID: brief.id,
|
|
97
97
|
Status: formatStatus(brief.status),
|
|
98
|
-
"Content Type": brief.content_type
|
|
98
|
+
"Content Type": formatContentType(brief.content_type),
|
|
99
99
|
"Search Intent": brief.search_intent || "-",
|
|
100
100
|
"Target Words": brief.target_word_count || "-",
|
|
101
101
|
Created: formatDate(brief.created_at),
|
|
102
102
|
Updated: brief.updated_at ? formatDate(brief.updated_at) : "-",
|
|
103
103
|
});
|
|
104
|
-
|
|
104
|
+
// Use original user-specified keywords if available (targetKeywords gets
|
|
105
|
+
// overwritten with expanded keywords during outline generation)
|
|
106
|
+
const originalKeywords = brief.progress_details?.originalKeywords;
|
|
107
|
+
const displayKeywords = (originalKeywords && originalKeywords.length > 0)
|
|
108
|
+
? originalKeywords
|
|
109
|
+
: brief.target_keywords;
|
|
110
|
+
if (displayKeywords && displayKeywords.length > 0) {
|
|
105
111
|
markdown += "\n## Target Keywords\n\n";
|
|
106
|
-
for (const keyword of
|
|
112
|
+
for (const keyword of displayKeywords) {
|
|
107
113
|
markdown += `- ${keyword}\n`;
|
|
108
114
|
}
|
|
109
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"briefs.js","sourceRoot":"","sources":["../../src/resources/briefs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"briefs.js","sourceRoot":"","sources":["../../src/resources/briefs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AA0BxG,+CAA+C;AAC/C,gBAAgB;AAChB,+CAA+C;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAC3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAElD,+CAA+C;AAC/C,qBAAqB;AACrB,+CAA+C;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC;QACE,WAAW,EAAE,2BAA2B;QACxC,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,4CAA4C;QACzD,QAAQ,EAAE,eAAe;KAC1B;CACF,CAAC;AAaF,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAoB;IAEpB,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,CACvC,SAAS,EACT,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,EAC1B,SAAS,CAAC,KAAK,CAChB,CAAC;QAEF,MAAM,SAAS,GAAoB;YACjC;gBACE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,MAAM,CAAC;QAC5F,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,+CAA+C;AAC/C,eAAe;AACf,+CAA+C;AAE/C,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,OAAO,GAAG,KAAK,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-visibility.d.ts","sourceRoot":"","sources":["../../src/tools/ai-visibility.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,UAAU,EAGX,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ai-visibility.d.ts","sourceRoot":"","sources":["../../src/tools/ai-visibility.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,UAAU,EAGX,MAAM,aAAa,CAAC;AAwIrB,eAAO,MAAM,mBAAmB,EAAE,iBAiBjC,CAAC;AAEF,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CA8GrB;AAYD,eAAO,MAAM,eAAe,EAAE,iBAoB7B,CAAC;AAEF,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CA8CrB;AAiBD,eAAO,MAAM,gBAAgB,EAAE,iBA8C9B,CAAC;AAEF,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CA8CrB;AAUD,eAAO,MAAM,aAAa,EAAE,iBAa3B,CAAC;AAEF,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAiErB;AAcD,eAAO,MAAM,gBAAgB,EAAE,iBAiC9B,CAAC;AAEF,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAoCrB;AAaD,eAAO,MAAM,kBAAkB,EAAE,iBAwBhC,CAAC;AAEF,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAwDrB;AAWD,eAAO,MAAM,aAAa,EAAE,iBAgB3B,CAAC;AAEF,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAsDrB;AAYD,eAAO,MAAM,eAAe,EAAE,iBAoB7B,CAAC;AAEF,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAoErB;AAoBD,eAAO,MAAM,kBAAkB,EAAE,iBAqBhC,CAAC;AAEF,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAqDrB;AAMD,eAAO,MAAM,iBAAiB,EAAE,iBAAiB,EAUhD,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CACxC,MAAM,EACN,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,CAW9D,CAAC"}
|
|
@@ -11,10 +11,11 @@ import { formatTable, formatStatus, formatDate, formatPagination, formatKeyValue
|
|
|
11
11
|
// ============================================
|
|
12
12
|
const getAiVisibilityInputSchema = z.object({
|
|
13
13
|
days: z.number().min(1).max(90).optional().default(30),
|
|
14
|
+
site_id: z.string().optional(),
|
|
14
15
|
});
|
|
15
16
|
export const getAiVisibilityTool = {
|
|
16
17
|
name: "get_ai_visibility",
|
|
17
|
-
description: "Get an overview of your AI visibility metrics - how your content appears in AI search results like ChatGPT, Perplexity, etc.",
|
|
18
|
+
description: "Get an overview of your AI visibility metrics - how your content appears in AI search results like ChatGPT, Perplexity, etc. Use site_id to filter to a specific site (recommended), or omit for aggregated data across all sites.",
|
|
18
19
|
inputSchema: {
|
|
19
20
|
type: "object",
|
|
20
21
|
properties: {
|
|
@@ -22,6 +23,10 @@ export const getAiVisibilityTool = {
|
|
|
22
23
|
type: "number",
|
|
23
24
|
description: "Number of days to look back (1-90, default: 30)",
|
|
24
25
|
},
|
|
26
|
+
site_id: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Site ID for per-site metrics. Use list_sites to get available IDs. If omitted, returns aggregated data across all sites.",
|
|
29
|
+
},
|
|
25
30
|
},
|
|
26
31
|
},
|
|
27
32
|
};
|
|
@@ -33,9 +38,11 @@ export async function executeGetAiVisibility(input, context) {
|
|
|
33
38
|
markdown: `**Error:** Invalid input - ${parsed.error.message}`,
|
|
34
39
|
};
|
|
35
40
|
}
|
|
36
|
-
const { days } = parsed.data;
|
|
41
|
+
const { days, site_id } = parsed.data;
|
|
37
42
|
try {
|
|
38
43
|
const params = { days };
|
|
44
|
+
if (site_id)
|
|
45
|
+
params.site_id = site_id;
|
|
39
46
|
const response = await context.client.get("/ai-visibility", params, CACHE_TTL.resources);
|
|
40
47
|
const data = response.data;
|
|
41
48
|
if (!data) {
|
|
@@ -46,14 +53,39 @@ export async function executeGetAiVisibility(input, context) {
|
|
|
46
53
|
};
|
|
47
54
|
}
|
|
48
55
|
const overview = data.overview;
|
|
56
|
+
const overviewPrompts = data.prompts ?? [];
|
|
57
|
+
// Appearance rate: % of prompts where brand is visible (matches app definition)
|
|
58
|
+
const appearanceRate = overviewPrompts.length > 0
|
|
59
|
+
? Math.round((overviewPrompts.filter((p) => p.is_visible).length / overviewPrompts.length) * 100)
|
|
60
|
+
: null;
|
|
61
|
+
// Citation rate: % of prompts where brand is cited
|
|
62
|
+
const citationRate = overviewPrompts.length > 0
|
|
63
|
+
? Math.round((overviewPrompts.filter((p) => p.is_cited).length / overviewPrompts.length) * 100)
|
|
64
|
+
: null;
|
|
49
65
|
let markdown = `## AI Visibility Overview (Last ${overview.period_days} days)\n\n`;
|
|
50
66
|
markdown += formatKeyValue({
|
|
51
67
|
total_prompts: overview.total_prompts ?? 0,
|
|
52
|
-
avg_visibility_score: overview.avg_visibility_score != null ? overview.avg_visibility_score
|
|
68
|
+
avg_visibility_score: overview.avg_visibility_score != null ? `${overview.avg_visibility_score}/100` : "N/A",
|
|
69
|
+
share_of_voice: overview.share_of_voice != null ? `${overview.share_of_voice}%` : "N/A (provide site_id for SOV)",
|
|
70
|
+
appearance_rate: appearanceRate != null ? `${appearanceRate}%` : "N/A",
|
|
71
|
+
citation_rate: citationRate != null ? `${citationRate}%` : "N/A",
|
|
53
72
|
total_checks: overview.total_checks ?? 0,
|
|
54
73
|
total_mentions: overview.total_mentions ?? 0,
|
|
55
74
|
total_citations: overview.total_citations ?? 0,
|
|
56
75
|
});
|
|
76
|
+
// Show competitor SOV breakdown if available
|
|
77
|
+
const competitorBreakdown = overview.competitor_breakdown ?? [];
|
|
78
|
+
if (competitorBreakdown.length > 0) {
|
|
79
|
+
markdown += "\n\n### Share of Voice Breakdown\n\n";
|
|
80
|
+
const sovHeaders = ["Competitor", "Mentions", "SOV"];
|
|
81
|
+
const sovRows = competitorBreakdown.map((c) => [
|
|
82
|
+
c.name,
|
|
83
|
+
c.mentions.toString(),
|
|
84
|
+
`${c.sov}%`,
|
|
85
|
+
]);
|
|
86
|
+
markdown += formatTable(sovHeaders, sovRows);
|
|
87
|
+
}
|
|
88
|
+
markdown += `\n\n> **Tip:** Use \`list_prompts\` and \`get_prompt\` for detailed per-prompt metrics.`;
|
|
57
89
|
const platforms = data.platform_breakdown ?? [];
|
|
58
90
|
if (platforms.length > 0) {
|
|
59
91
|
markdown += "\n\n### Platform Breakdown\n\n";
|
|
@@ -170,8 +202,10 @@ const createPromptInputSchema = z.object({
|
|
|
170
202
|
prompt_text: z.string().min(10).max(1000),
|
|
171
203
|
target_brand: z.string().min(1).max(255),
|
|
172
204
|
brand_variants: z.array(z.string()).optional(),
|
|
173
|
-
frequency: z.enum(["daily", "weekly"
|
|
205
|
+
frequency: z.enum(["daily", "weekly"]).optional().default("daily"),
|
|
174
206
|
platforms: z.array(z.string()).optional(),
|
|
207
|
+
category: z.enum(["brand", "competitors", "product", "problem", "commercial", "custom"]).optional().default("product"),
|
|
208
|
+
location: z.enum(["global", "us", "uk", "eu", "apac", "latam"]).optional().default("global"),
|
|
175
209
|
site_id: z.string().optional(),
|
|
176
210
|
});
|
|
177
211
|
export const createPromptTool = {
|
|
@@ -195,7 +229,7 @@ export const createPromptTool = {
|
|
|
195
229
|
},
|
|
196
230
|
frequency: {
|
|
197
231
|
type: "string",
|
|
198
|
-
enum: ["daily", "weekly"
|
|
232
|
+
enum: ["daily", "weekly"],
|
|
199
233
|
description: "How often to crawl this prompt (default: daily)",
|
|
200
234
|
},
|
|
201
235
|
platforms: {
|
|
@@ -203,9 +237,19 @@ export const createPromptTool = {
|
|
|
203
237
|
items: { type: "string" },
|
|
204
238
|
description: "AI platforms to track (e.g., chatgpt, perplexity, claude, gemini, google_ai, grok, copilot, deepseek)",
|
|
205
239
|
},
|
|
240
|
+
category: {
|
|
241
|
+
type: "string",
|
|
242
|
+
enum: ["brand", "competitors", "product", "problem", "commercial", "custom"],
|
|
243
|
+
description: "Prompt category (default: product)",
|
|
244
|
+
},
|
|
245
|
+
location: {
|
|
246
|
+
type: "string",
|
|
247
|
+
enum: ["global", "us", "uk", "eu", "apac", "latam"],
|
|
248
|
+
description: "Geographic location for tracking (default: global)",
|
|
249
|
+
},
|
|
206
250
|
site_id: {
|
|
207
251
|
type: "string",
|
|
208
|
-
description: "Associate with a specific site",
|
|
252
|
+
description: "Associate with a specific site (strongly recommended — prompts without a site_id will NOT appear in the Frase app). Use list_sites to get available IDs.",
|
|
209
253
|
},
|
|
210
254
|
},
|
|
211
255
|
required: ["prompt_text", "target_brand"],
|
|
@@ -219,9 +263,9 @@ export async function executeCreatePrompt(input, context) {
|
|
|
219
263
|
markdown: `**Error:** Invalid input - ${parsed.error.message}`,
|
|
220
264
|
};
|
|
221
265
|
}
|
|
222
|
-
const { prompt_text, target_brand, brand_variants, frequency, platforms, site_id } = parsed.data;
|
|
266
|
+
const { prompt_text, target_brand, brand_variants, frequency, platforms, category, location, site_id } = parsed.data;
|
|
223
267
|
try {
|
|
224
|
-
const body = { prompt_text, target_brand, frequency };
|
|
268
|
+
const body = { prompt_text, target_brand, frequency, category, location };
|
|
225
269
|
if (brand_variants)
|
|
226
270
|
body.brand_variants = brand_variants;
|
|
227
271
|
if (platforms)
|
|
@@ -235,9 +279,13 @@ export async function executeCreatePrompt(input, context) {
|
|
|
235
279
|
prompt_text: prompt.prompt_text,
|
|
236
280
|
status: prompt.status,
|
|
237
281
|
});
|
|
282
|
+
let markdown = `## Prompt Created\n\n${details}\n\n**Note:** The prompt will be crawled automatically. Use \`get_prompt\` to see results.`;
|
|
283
|
+
if (!site_id) {
|
|
284
|
+
markdown += `\n\n> **Warning:** No site_id was provided. This prompt may not appear in site-scoped views in the Frase app. Recreate the prompt with a site_id to ensure visibility.`;
|
|
285
|
+
}
|
|
238
286
|
return {
|
|
239
287
|
success: true,
|
|
240
|
-
markdown
|
|
288
|
+
markdown,
|
|
241
289
|
data: response,
|
|
242
290
|
};
|
|
243
291
|
}
|
|
@@ -331,7 +379,7 @@ export async function executeGetPrompt(input, context) {
|
|
|
331
379
|
const updatePromptInputSchema = z.object({
|
|
332
380
|
id: z.string().min(1),
|
|
333
381
|
status: z.enum(["active", "paused", "archived"]).optional(),
|
|
334
|
-
frequency: z.enum(["daily", "weekly"
|
|
382
|
+
frequency: z.enum(["daily", "weekly"]).optional(),
|
|
335
383
|
platforms: z.array(z.string()).optional(),
|
|
336
384
|
brand_variants: z.array(z.string()).optional(),
|
|
337
385
|
});
|
|
@@ -352,7 +400,7 @@ export const updatePromptTool = {
|
|
|
352
400
|
},
|
|
353
401
|
frequency: {
|
|
354
402
|
type: "string",
|
|
355
|
-
enum: ["daily", "weekly"
|
|
403
|
+
enum: ["daily", "weekly"],
|
|
356
404
|
description: "How often to crawl this prompt",
|
|
357
405
|
},
|
|
358
406
|
platforms: {
|
|
@@ -407,6 +455,7 @@ const getCompetitorsInputSchema = z.object({
|
|
|
407
455
|
page: z.number().min(1).optional().default(1),
|
|
408
456
|
page_size: z.number().min(1).max(100).optional().default(20),
|
|
409
457
|
days: z.number().min(1).max(90).optional().default(30),
|
|
458
|
+
site_id: z.string().optional(),
|
|
410
459
|
});
|
|
411
460
|
export const getCompetitorsTool = {
|
|
412
461
|
name: "get_competitors",
|
|
@@ -426,6 +475,10 @@ export const getCompetitorsTool = {
|
|
|
426
475
|
type: "number",
|
|
427
476
|
description: "Number of days to look back (1-90, default: 30)",
|
|
428
477
|
},
|
|
478
|
+
site_id: {
|
|
479
|
+
type: "string",
|
|
480
|
+
description: "Filter competitors by site ID. Use list_sites to get available IDs.",
|
|
481
|
+
},
|
|
429
482
|
},
|
|
430
483
|
},
|
|
431
484
|
};
|
|
@@ -437,9 +490,11 @@ export async function executeGetCompetitors(input, context) {
|
|
|
437
490
|
markdown: `**Error:** Invalid input - ${parsed.error.message}`,
|
|
438
491
|
};
|
|
439
492
|
}
|
|
440
|
-
const { page, page_size, days } = parsed.data;
|
|
493
|
+
const { page, page_size, days, site_id } = parsed.data;
|
|
441
494
|
try {
|
|
442
495
|
const params = { page, page_size, days };
|
|
496
|
+
if (site_id)
|
|
497
|
+
params.site_id = site_id;
|
|
443
498
|
const response = await context.client.get("/ai-visibility/competitors", params, CACHE_TTL.resources);
|
|
444
499
|
const competitors = Array.isArray(response.data) ? response.data : [];
|
|
445
500
|
if (competitors.length === 0) {
|