Skip to main content
Glama

execute

Run JavaScript async function against a YouTube channel to chain Data, Analytics, Reporting API calls, transcripts, and search autocomplete with quota and confirmation gates.

Instructions

Run a JavaScript async function body against the user's YouTube channel. Call docs() first for recipes, quota rules, and gotchas. Use search() to look up method parameters.

The yt client: yt.data..(params, body?, { confirm? }) YouTube Data API v3, e.g. yt.data.videos.list({ part: "snippet,statistics", id: ["a", "b"] }) yt.analytics.query(params) YouTube Analytics v2 reports.query; ids defaults to channel==MINE, dates to the last 28 days; returns { columns, rows: object[] } yt.reporting..(params, body?) YouTube Reporting v1 yt.reporting.download(downloadUrl, { maxChars? }) CSV text of a report, default cap 50,000 chars yt.paginate(fn, params, { max }) follows nextPageToken, returns items yt.transcript(videoId, { lang? }) captions of any public video, no quota: { language, isGenerated, fullText, segments, available } yt.suggest(query, { lang? }) YouTube search autocomplete, no quota yt.upload(absPath, { snippet, status }, { confirm }) resumable upload from local disk yt.setThumbnail(videoId, absPath, { confirm }) JPEG or PNG, 2 MB max yt.quota() yt.auth.status()

Confirm gate: deletes, uploads, comments, thumbnails, captions, reporting jobs, live transitions, and anything that sets privacyStatus to public return a dry run ({ dryRun, effect, wouldCall, cost }) and send nothing unless the call passes { confirm: true } as its last argument. Show the user the dry run and get approval before confirming. Helpers in scope: formatDuration(iso), durationSeconds(iso), isLikelyShort(iso), toRows(analyticsResponse).

Chain many calls in one program and return a compact, aggregated result. Errors thrown by yt carry status, reason (e.g. quotaExceeded, authRequired, invalidParams), and message, and can be caught. The sandbox has no network, env, or filesystem; credentials stay on the host. Limits: 60s wall clock, 500 yt calls, 100 KB of returned JSON.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesAsync function body. Use return.
quotaBudgetNoMax Data API units this run may spend. Calls past it throw quotaBudgetExceeded and send nothing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: the confirm gate enumerates exactly which operations dry-run (deletes, uploads, comments, thumbnails, captions, reporting jobs, live transitions, public privacyStatus), the dry-run return shape is given, error objects expose status/reason/message, and hard limits (60s, 500 calls, 100 KB) plus sandbox isolation and host-side credentials are disclosed.

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?

Purpose is front-loaded in the first sentence, the SDK surface is presented as a scannable aligned list, and the constraints are grouped into coherent paragraphs. Given the genuine complexity of the client, the length is largely earned, though the density is high and a couple of lines could be trimmed.

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

Completeness5/5

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

For a high-complexity code-execution tool with no output schema, the description supplies everything an agent needs: the full client API, helper functions in scope, the confirmation workflow, error model, and execution limits. Nothing material about calling or interpreting the result is missing.

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 description coverage is 100% for both parameters, so the schema already documents `code` and `quotaBudget`, including the quotaBudgetExceeded behavior. The description adds implicit intent ('Chain many calls in one program and return a compact, aggregated result') but no syntax or format detail beyond the schema, so the baseline 3 applies.

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 opening sentence states a specific verb and resource: 'Run a JavaScript async function body against the user's YouTube channel.' It immediately separates itself from the docs and search siblings by naming them as prerequisites rather than alternatives, so an agent knows this is the execution surface and not a lookup surface.

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

Usage Guidelines5/5

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

It explicitly routes to the siblings: 'Call docs() first for recipes, quota rules, and gotchas' and 'Use search() to look up method parameters.' The confirm-gate paragraph also states the when-not condition for writing operations (dry run unless { confirm: true }), giving both usage and a control-flow constraint.

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

Deploy Server

Other Tools