Skip to main content
Glama

update_activity_state

Modify the status of an Adobe Target activity by specifying a tenant and new state to control campaign execution.

Instructions

Update the state of an activity in Adobe Target.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tenantYesThe tenant identifier.
stateYesThe new state to set for the activity.

Implementation Reference

  • Handler function that executes the tool: sends PUT request to Adobe Target API to update activity state for a given tenant.
    const executeFunction = async ({ tenant, state }) => { const baseUrl = 'https://mc.adobe.io'; const apiKey = process.env.ADOBE_API_KEY; const token = process.env.ADOBE_API_KEY; try { // Construct the URL for the request const url = `${baseUrl}/${tenant}/target/activities/ab/168816/state`; // Set up headers for the request const headers = { 'Authorization': `Bearer ${token}`, 'X-Api-Key': apiKey, 'Content-Type': 'application/vnd.adobe.target.v1+json' }; // Set up the body of the request const body = JSON.stringify({ state }); // Perform the fetch request const response = await fetch(url, { method: 'PUT', headers, body }); // Check if the response was successful if (!response.ok) { const errorData = await response.json(); throw new Error(errorData); } // Parse and return the response data const data = await response.json(); return data; } catch (error) { console.error('Error updating activity state:', error); return { error: 'An error occurred while updating the activity state.' }; } };
  • Tool definition including schema for input parameters (tenant, state), description, and reference to handler function.
    const apiTool = { function: executeFunction, definition: { type: 'function', function: { name: 'update_activity_state', description: 'Update the state of an activity in Adobe Target.', parameters: { type: 'object', properties: { tenant: { type: 'string', description: 'The tenant identifier.' }, state: { type: 'string', description: 'The new state to set for the activity.' } }, required: ['tenant', 'state'] } } } };
  • lib/tools.js:7-16 (registration)
    Dynamic tool discovery and registration: imports apiTool from each tool file listed in toolPaths and collects them into an array of tools.
    export async function discoverTools() { const toolPromises = toolPaths.map(async (file) => { const module = await import(`../tools/${file}`); return { ...module.apiTool, path: file, }; }); return Promise.all(toolPromises); }
  • mcpServer.js:102-104 (registration)
    Loads the discovered tools in the MCP server main entry point.
    const tools = await discoverTools(); console.log("🧰 Tools discovered:", tools.map(t => t.definition?.function?.name));
  • Lists paths to all tool implementation files, used by discoverTools.
    export const toolPaths = [ 'adobe/adobe-target-admin-ap-is/update-activity-state.js', 'adobe/adobe-target-admin-ap-is/update-activity-priority.js', 'adobe/adobe-target-admin-ap-is/update-activity-schedule.js' ];

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Amit-Lakhani/mcp1'

If you have feedback or need assistance with the MCP directory API, please join our Discord server