Skip to main content
Glama

mcp-google-sheets

find-branch.ts1.28 kB
import { createAction, Property } from '@activepieces/pieces-framework'; import { githubAuth } from '../../index'; import { githubApiCall, githubCommon } from '../common'; import { HttpError, HttpMethod } from '@activepieces/pieces-common'; import { HttpStatusCode } from 'axios'; export const githubFindBranchAction = createAction({ auth: githubAuth, name: 'find_branch', displayName: 'Find Branch', description: 'Finds a branch by name and returns its details.', props: { repository: githubCommon.repositoryDropdown, branch: Property.ShortText({ displayName: 'Branch Name', required: true, }), }, async run({ auth, propsValue }) { const { owner, repo } = propsValue.repository!; const branchName = propsValue.branch; try { const response = await githubApiCall({ accessToken: auth.access_token, method: HttpMethod.GET, resourceUri: `/repos/${owner}/${repo}/branches/${branchName}`, }); return { found: true, result: response.body, }; } catch (e) { const status = (e as HttpError).response.status; if (status === HttpStatusCode.NotFound) { return { found: false, result: {}, }; } throw e; } }, });

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/activepieces/activepieces'

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