add_keyword
Add a keyword to a project to monitor AI engine visibility across all configured engines on the next report run.
Instructions
Add a single keyword (prompt) to a project. SurfRank will query every configured AI engine with this prompt on the next report run.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | ||
| phrase | Yes | The prompt text, e.g. "best crm software" |
Implementation Reference
- src/tools/keywords.js:27-28 (handler)The handler function for the 'add_keyword' tool. It calls api.post with the projectId and phrase to add a single keyword/prompt to a project.
handler: async ({ projectId, phrase }) => api.post(`/projects/${projectId}/keywords`, { phrase }), - src/tools/keywords.js:19-26 (schema)The input schema for the 'add_keyword' tool, requiring projectId and phrase properties.
inputSchema: { type: 'object', properties: { projectId: { type: 'string' }, phrase: { type: 'string', description: 'The prompt text, e.g. "best crm software"' }, }, required: ['projectId', 'phrase'], }, - src/index.js:31-39 (registration)The 'add_keyword' tool is registered as part of keywordTools array which is spread into ALL_TOOLS and indexed by name in the toolByName Map.
const ALL_TOOLS = [ ...projectTools, ...keywordTools, ...reportTools, ...quickTestTools, ...keywordResearchTools, ...competitorTools, ...opportunityTools, ]; - src/index.js:24-24 (registration)The import of keywordTools from the keywords.js file into the main index.js entry point.
import { keywordTools } from './tools/keywords.js'; - src/client.js:78-83 (helper)The api.post method used by the add_keyword handler to make the HTTP POST request to the SurfRank API.
export const api = { get: (path, query) => request('GET', path, { query }), post: (path, body) => request('POST', path, { body }), patch: (path, body) => request('PATCH', path, { body }), delete: (path) => request('DELETE', path), };