Skip to main content
Glama
railsware

Coupler Analytics

by railsware

get-dataflow

Retrieve details of a Coupler.io data flow by its ID to access its configuration and status.

Instructions

Get a Coupler.io data flow by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataflowIdYesThe ID of the data flow with a successful run.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataflowYes

Implementation Reference

  • Main handler function for the get-dataflow tool. Validates input with zod, makes a GET request to Coupler.io API /dataflows/{dataflowId}{?type}, and returns the dataflow JSON.
    export const handler = async (params?: Record<string, unknown>): Promise<CallToolResult> => {
      const validationResult = zodInputSchema.safeParse(params)
    
      if (!validationResult.success) {
        const error = fromError(validationResult.error)
        logger.error(`Invalid parameters for get-dataflow tool: ${error.toString()}`)
    
        return textResponse({
          text: `Invalid parameters for get-dataflow tool. ${error.toString()}`,
          isError: true,
        })
      }
    
      const coupler = new CouplerioClient({ auth: COUPLER_ACCESS_TOKEN })
      const response = await coupler.request('/dataflows/{dataflowId}{?type}', {
        expand: {
          dataflowId: validationResult.data.dataflowId,
          type: 'from_template'
        },
        request: {
          method: 'GET'
        }
      })
    
      if (!response.ok) {
        const errorText = await buildErrorMessage( { response, customText: `Failed to get data flow ${validationResult.data.dataflowId}.`})
        
        logger.error(errorText)
        return textResponse({
          isError: true,
          text: errorText
        })
      }
    
      const dataflow = await response.json()
    
      return textResponse({ text: JSON.stringify(dataflow, null, 2), structuredContent: { dataflow } })
    }
  • Input and output schemas using Zod. Input requires 'dataflowId' as a non-empty string. Output describes the dataflow object with id, name, schedule, sources, etc.
    import { z } from 'zod'
    import { zodToJsonSchema } from 'zod-to-json-schema'
    
    export const zodInputSchema = z.object({
      dataflowId: z.string()
        .min(1, 'dataflowId is required.')
        .regex(/^\S+$/, 'dataflowId must not be empty.')
        .describe('The ID of the data flow with a successful run.')
    }).strict()
    
    export const inputSchema = zodToJsonSchema(zodInputSchema)
    
    const zodOutputSchema = z.object({
      dataflow: z.object({
        id: z.string().describe('The ID of the data flow.'),
        name: z.string().describe('The name of the data flow.'),
        last_successful_execution_id: z.string().describe('The ID of the last successful run (execution) of the data flow.'),
        schedule: z.string().nullish().describe('The schedule of the data flow. Crontab format.'),
        sources: z.array(z.object({
          id: z.string().describe('The ID of the source.'),
          name: z.string().describe('The name of the source.'),
          type: z.string().describe('The type of the source.'),
          params_configured: z.boolean().describe('Whether the source params are configured.'),
          enabled: z.boolean().describe('Whether the source is enabled.'),
          data_connections_count: z.number().int().nonnegative().describe('The number of data connections for the source.'),
          last_success_run_at: z.string().nullish().describe('The date and time of the last successful run of the source. ISO 8601 format.'),
          error_details: z.string().nullish().describe('The error details of the source.'),
        })).describe('The sources of the data flow.'),
      })
    })
    
    export const outputSchema = zodToJsonSchema(zodOutputSchema)
  • Exports the tool's name, description, handler, and toolListEntry (which includes inputSchema, outputSchema, annotations). This is used by the server to register and list the tool.
    import { inputSchema, outputSchema } from './schema.js'
    
    export { handler } from './handler.js'
    
    export const name = 'get-dataflow'
    export const description = 'Get a Coupler.io data flow by ID.'
    
    const annotations = {
      title: 'Get a Coupler.io data flow by ID.'
    }
    
    export const toolListEntry = {
      name,
      description,
      inputSchema,
      outputSchema,
      annotations,
    }
  • Import of the get-dataflow tool module into the server.
    import * as getDataflow from '../tools/get-dataflow/index.js'
  • Registration of the get-dataflow handler in the TOOL_MAP, mapping the tool name to its handler function.
    [getDataflow.name]: getDataflow.handler,
Behavior3/5

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

The description is accurate but does not disclose any behavioral traits beyond being a read operation. With minimal annotations (title only), the description carries the burden but omits details like idempotency, caching, or error behavior. No contradiction with annotations.

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

Conciseness4/5

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

The description is very concise (one sentence) with no wasted words. However, it lacks additional details that could be included without bloat.

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

Completeness3/5

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

Given the tool's simplicity (1 parameter, output schema exists), the description is minimally adequate. It misses usage guidelines and any prerequisites, but the output schema compensates for return value documentation.

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

Parameters3/5

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

Schema coverage is 100%, and the schema already provides a description for the only parameter (dataflowId). The tool description adds no additional meaning beyond the schema, so baseline 3 is appropriate.

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?

The description clearly states the action (Get) and the resource (a Coupler.io data flow by ID). It distinguishes from siblings like 'list-dataflows' (list) and 'get-data'/'get-schema' (different entities).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives (e.g., when to use 'list-dataflows' or 'get-data'). No explicit 'when to use' or 'when not to use' context.

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/railsware/coupler-io-mcp-server'

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