Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

1.1 KB
Raw Blame
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod } from '@activepieces/pieces-common';
import { pubrioAuth } from '../../index';
import { pubrioRequest } from '../common';

export const lookupNews = createAction({
  auth: pubrioAuth,
  name: 'lookup_news',
  classification: 'READ',
  displayName: 'Lookup News',
  description: 'Look up detailed news information by news search ID',
  audience: 'both',
  aiMetadata: {
    description:
      'Fetch the full detail of one news item given a news_search_id (obtained from a prior news search). Read-only and repeatable. Use to expand a single news result into its complete record.',
    idempotent: true,
  },
  props: {
    news_search_id: Property.ShortText({
      displayName: 'News Search ID',
      required: true,
      description: 'The news search ID to look up',
    }),
  },
  async run(context) {
    const body: Record<string, unknown> = {
      news_search_id: context.propsValue.news_search_id,
    };
    return await pubrioRequest(
      context.auth.secret_text,
      HttpMethod.POST,
      '/companies/news/lookup',
      body
    );
  },
});