Skip to main content
Glama
alexleventer

Marketo MCP Server

by alexleventer

marketo_get_forms

List Marketo forms filtered by approval status and paginated. Retrieve form metadata including URL, status, and folder location.

Instructions

List forms in the Marketo instance. Filter by approval status (approved/draft) and paginate with maxReturn/offset. Returns form metadata including URL, status, and folder location.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxReturnNo
offsetNo
statusNo

Implementation Reference

  • src/index.ts:81-97 (registration)
    Registration of the 'marketo_get_forms' tool via server.tool(), defining its description, schema (maxReturn, offset, status), and binding it to the handler function.
    server.tool(
      'marketo_get_forms',
      'List forms in the Marketo instance. Filter by approval status (approved/draft) and paginate with maxReturn/offset. Returns form metadata including URL, status, and folder location.',
      {
        maxReturn: z.number().optional(),
        offset: z.number().optional(),
        status: z.enum(['approved', 'draft']).optional(),
      },
      tool(async ({ maxReturn = 200, offset = 0, status }) => {
        const params = new URLSearchParams({
          maxReturn: maxReturn.toString(),
          offset: offset.toString(),
        });
        if (status) params.append('status', status);
        return makeApiRequest(`/asset/v1/forms.json?${params.toString()}`, 'GET');
      })
    );
  • Input schema definition for marketo_get_forms: maxReturn (optional number), offset (optional number), status (optional enum: 'approved'|'draft').
    {
      maxReturn: z.number().optional(),
      offset: z.number().optional(),
      status: z.enum(['approved', 'draft']).optional(),
    },
  • Handler function for marketo_get_forms. Constructs query params from inputs, calls Marketo API GET /asset/v1/forms.json with pagination and optional status filter.
    tool(async ({ maxReturn = 200, offset = 0, status }) => {
      const params = new URLSearchParams({
        maxReturn: maxReturn.toString(),
        offset: offset.toString(),
      });
      if (status) params.append('status', status);
      return makeApiRequest(`/asset/v1/forms.json?${params.toString()}`, 'GET');
    })
  • makeApiRequest helper function that performs authenticated HTTP requests to the Marketo API using an access token fetched via TokenManager.
    async function makeApiRequest(
      endpoint: string,
      method: string,
      data?: any,
      contentType: string = 'application/json'
    ) {
      const token = await tokenManager.getToken();
      const headers: Record<string, string> = {
        Authorization: `Bearer ${token}`,
      };
    
      if (contentType) {
        headers['Content-Type'] = contentType;
      }
    
      try {
        const response = await axios({
          url: `${MARKETO_BASE_URL}${endpoint}`,
          method,
          data:
            contentType === 'application/x-www-form-urlencoded'
              ? new URLSearchParams(data).toString()
              : data,
          headers,
        });
        return response.data;
      } catch (error: any) {
        console.error('API request failed:', error.response?.data || error.message);
        throw error;
      }
    }
  • The 'tool' wrapper function that wraps handler functions with try/catch, returning success JSON content or error responses with isError flag.
    function tool<T>(handler: (args: T) => Promise<unknown>) {
      return async (args: T) => {
        try {
          const response = await handler(args);
          return {
            content: [{ type: 'text' as const, text: JSON.stringify(response, null, 2) }],
          };
        } catch (error: any) {
          return {
            content: [
              {
                type: 'text' as const,
                text: `Error: ${error.response?.data?.message || error.message}`,
              },
            ],
            isError: true,
          };
        }
      };
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It describes the operation as listing (read-like) but does not explicitly state it is non-destructive, safe, or idempotent. Adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences front-load the main action and cover purpose, filtering, pagination, and output. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, description mentions returned fields (URL, status, folder location). Covers purpose and parameters well, though could mention default pagination values or rate limits.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description fully explains all three parameters: status (approved/draft), maxReturn and offset for pagination. Provides meaning beyond raw schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the verb 'list' and resource 'forms' with scope 'Marketo instance'. It distinguishes from siblings like marketo_get_form_by_id by implying a list vs. specific form retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for listing forms with filtering and pagination, but does not explicitly contrast with sibling tools like marketo_get_form_by_id. Clear context but lacks explicit when-not-to-use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/alexleventer/marketo-mcp'

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