Skip to main content
Glama

update_activity_state

Update an activity's state in Adobe Target using the Postman MCP Generator. Specify the tenant identifier and desired state to manage activity configurations effectively.

Instructions

Update the state of an activity in Adobe Target.

Input Schema

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

Implementation Reference

  • Core handler function that executes the tool logic: authenticates with Adobe API keys, constructs the API URL for the specific activity (ab/168816), sends a PUT request with the new state, and handles response or errors.
    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.' }; } };
  • JSON Schema for the tool's input parameters, requiring 'tenant' (string) and 'state' (string). Defines the structure for validation.
    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)
    Registers the tool by dynamically importing the apiTool export from each tool file listed in toolPaths (including this tool) and returning an array of tool definitions for use in MCP.
    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); }
  • tools/paths.js:1-5 (registration)
    Central list of all tool module paths used by discoverTools to load and register tools, including the path to update_activity_state.
    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' ];

Other Tools

Related Tools

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