Skip to main content
Glama
seer22

io.github.seer22/shturman-direct-mcp

by seer22

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
SHTURMAN_PLANS_DIRNoWhere write plans are stored. Default: 'var/plans' in the installation tree.
SHTURMAN_BEZ_KASSETNoSet to '1' to turn cassette recording off.
SHTURMAN_KASSETY_DIRNoWhere cassettes are written. Default: 'var/kassety' under the working directory.
SHTURMAN_DIRECT_TOKENNoOAuth token for Direct. Takes precedence over the stored token file.
SHTURMAN_KASSETA_AVTORNoAuthor label recorded in each cassette line.
SHTURMAN_METRIKA_TOKENNoOAuth token for Metrika. Takes precedence over the stored token file.
SHTURMAN_AUDIENCE_TOKENNoOAuth token for Yandex Audience. Takes precedence over the stored token file.
SHTURMAN_SEARCHAPI_TOKENNoApi-Key of a Yandex Cloud service account, for Wordstat. Takes precedence over the stored token file.
SHTURMAN_DIRECT_CLIENT_IDNoClient ID of your own registered OAuth application for Direct. Needed for the 'login' flow.
SHTURMAN_METRIKA_CLIENT_IDNoClient ID of your own registered OAuth application for Metrika. Needed for the 'login' flow.
SHTURMAN_AUDIENCE_CLIENT_IDNoClient ID of your own registered OAuth application for Audience. Needed for the 'login' flow.
SHTURMAN_SEARCHAPI_FOLDER_IDNoID of the Yandex Cloud folder every Wordstat call bills to. Required for Wordstat.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{}
resources
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
direct_statusA

Where things stand: which credentials are configured, what this server knows and when it was measured, and what it will not do. Call this first in a session — it says what is possible before anything is attempted.

direct_readA

Call any reading method of the Direct API v501 — campaigns.get, ads.get, keywords.get and so on — and get the result. Refuses anything that changes state: those go through direct_plan and direct_apply.

Cost in API units is checked before the call, not read from a header afterwards. Read knowledge://traps first: several read methods return an empty-looking answer unless the right field names are asked for, which looks like 'nothing was saved'.

Easy to miss: keywordsresearch.hassearchvolume answers whether a phrase has search demand (a boolean, not a figure), and dictionaries.get returns the reference books — regions and minimum bids among them.

direct_planA

Turn a list of intended API calls into a plan and return its identifier. Nothing is sent. The plan lists what would run and what it would cost in units.

Use this for every change. direct_apply accepts only an identifier and has no parameter for a request body, so the change that was read is the change that runs.

A plan that writes must also carry 'verify' — reading calls to run afterwards. This API reports success and sometimes does something else; without a read-back the outcome is unknown.

direct_applyA

Perform the calls of a plan made earlier. Takes the plan identifier and a confirmation phrase — and nothing else.

This changes a live advertising account: Direct's sandbox is off unless switched on in the account, so a first write is real. There is no transaction, so a failure halfway leaves a partial state, and the tool says so.

It cannot start ads or unarchive: those methods are absent from this server.

direct_reportA

Ask for a report and get its rows. Reports cost no API units, which makes them always cheaper than rebuilding the same numbers from object calls.

🔴 The period is checked before the request. Yandex keeps about three years of statistics and the boundary slides forward on the first of every month — and a request reaching past it does NOT fail. It returns the part that still exists, labelled with the dates you asked for, and nothing says it was cut. This tool refuses instead, and names the boundary.

Dates are explicit rather than relative, so the same request means the same thing tomorrow.

direct_media_attachA

Attach local images or videos to an existing ad, doing the whole chain rather than one call.

A video takes three steps: uploading it puts it in the media library and nothing else, a creative has to be made from it, and only then can it go on the ad. Every step reports success on its own, which is why this is one tool.

Updating an ad also means resending its headlines and texts unchanged — the account requires them even when only a video changes, although the documentation does not say so. This tool reads the ad first and does that for you, and it never sends the legacy field that would collapse the ad to a single headline.

It reads the ad back afterwards and shows the headline count.

direct_wordstatA

Frequency of search phrases from the Wordstat API (Yandex Search API v2, Yandex Cloud — not the Direct API). Methods: 'top' — a phrase's frequency plus phrases containing it; 'dynamics' — demand over time; 'regions' — distribution across the world; 'tree' — the region code tree.

🔴 A call spends REAL MONEY from the cloud folder, not Direct API units: top and dynamics ~0.02 rubles each, regions ~0.05. 'tree' is FREE — start with it, both to take region codes from and to prove the credential works at no cost. The real bottleneck is the quota of 100 calls per sliding hour; it is seized locally BEFORE the network, and an exhausted quota is refused with the wait named.

Needs its own credential — a Yandex Cloud Api-Key and folder id: python -m shturman_direct login searchapi.

direct_metrikaA

The Yandex Metrika API, reading only. Three actions: 'counters' lists the counters this token can see; 'goals' lists one counter's goals; 'stat' answers one statistics slice — dimensions and metrics travel to the API as the ym:* names you write, and accuracy=full is sewn in because the service default is SAMPLING, on which a rare conversion rounds to zero while the report looks ordinary.

🔴 Data arrives with a lag of about 2 hours: the current day is underfilled, and judging it has produced wrong conclusions twice in a row. End the window yesterday.

Needs its own credential, not the Direct one: python -m shturman_direct login metrika. Creating goals is a write and lives in direct_metrika_goals.

direct_metrika_goalsA

Create JavaScript-event goals in one Metrika counter, idempotently: what the counter already has is checked by the event identifier first, only the missing goals are created, and the existing ones are never changed and never deleted. After creating, the counter is read back — a goal the read-back does not show is an error, not a footnote.

🔴 Goals must exist BEFORE the first ad click: retroactive credit does not exist in Metrika, and a duplicate goal is worse than a missing one — an autostrategy learns on doubled counts.

Called without a confirmation it answers a preview: ✓ already exists / + will be created. The confirmation phrase names the counter, so a write aimed at the wrong counter is caught at the moment of confirming.

direct_audienceA

The Yandex Audience API, reading only. Two actions: 'segments' lists the segments of the token's login — each with its owner and status (is_processed while counting, processed when ready); 'stat' answers one segment's reach and affinity — totals lives HERE, not in the segment object, and no_data=true means the segment is still counting, so its zero measures nothing.

🔴 Direct sees ONLY processed segments, and under a DIFFERENT number than the Audience id — a retargeting condition is verified by reading retargetinglists, never by computing (knowledge://audience).

Needs its own credential — a token of your own application with the two Audience checkboxes; no access request exists for this API: python -m shturman_direct login audience. Creating segments is a write and lives in direct_audience_segments.

direct_audience_segmentsA

Create ONE geo segment in Yandex Audience from CIRCLES — the one create path measured live. Polygons are recorded as knowledge only (knowledge://audience) and deliberately not implemented: their shape was never probed against the live service.

Radius is METERS, 500..10000 — the unit is proven by a two-sided probe; kilometers here would draw 500 km circles. A segment holds up to 1000 points, a 'condition' segment up to 100 (a limit bought by a live refusal), and 'condition' requires both period_length and times_quantity. Everything checkable is checked BEFORE the network, because the service's wrapper refusal masks every other complaint.

Called without a confirmation it answers a preview. After creating, the list is read back with the status — Direct sees the segment only after processed, and under a DIFFERENT number: verify by reading retargetinglists.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
audience5 limits, 9 traps and 2 caveats of the Yandex Audience API, almost all measured by refusals of the live service (measured 2026-09-01), plus the verb, path and body shape of 7 endpoints. The wrapper is a property of the method, not the transport; a segment binds to the login that issued the token; Direct sees only processed segments, and under a DIFFERENT number than the Audience id — read retargetinglists, never compute.
defaults30 recorded defaults of Direct and Metrika. The reading rule: 'did not touch' means 'accepted someone else's default' -- extended geotargeting is on, the timezone is Moscow, reports count conversions by a model the strategy does not learn by.
api-errorsWhat each refusal means and what to do about it. The field that matters is whether a retry is defensible: repeating a write after a timeout is how an account ends up with two identical live campaigns.
feeds63 records on feeds and product ads (SHOPPING_AD / LISTING_AD): 19 limits with citations, 14 traps, plus enums, YML requirements and what live accounts answered where the documentation is silent.
irreversibles15 prohibitions recorded BEFORE a plan leans on them: each classed as irreversible, interface-only, or nonexistent. Read this when a plan says 'I will do X, then change it' -- some X cannot be changed, and the discovery otherwise arrives after the write.
limits51 limits with 62 verbatim citations from the official documentation. Every number states the page it came from, so it can be checked rather than trusted.
maintenance8 thresholds, 4 rules and 6 reporting traps. Breaking one costs 7-14 days of strategy learning -- the whole budget of that period runs in the worst mode. Read before touching a running campaign.
metrika4 retention and quota limits with verbatim citations, 12 API-mechanics traps and 6 records of what does not exist (the Webvisor API above all). Authorization is OAuth, not Bearer; one service hides two APIs; the sampling default rounds a rare conversion to zero; goals count nothing retroactively -- a goal created after the first click has already lost those conversions forever.
money14 records on how Direct counts money: neighbouring fields in different VAT bases, report filters that are always in micro-units, rounding applied before summation, and minimums that live in a dictionary call rather than on any documentation page.
red-line11 methods. Most start ads serving, resume it or bring them back from the archive; the deletions are there because nothing can undo them. All absent rather than disabled: a guard made of a setting is not a guarantee.
transitions16 facts about status dictionaries and trajectories, plus 10 holes the documentation itself leaves open. A guard that fires on the normal course of business is worse than none: it gets scrolled past together with the real failures.
traps36 recorded cases, measured against a live account 2026-08-28. Read this before writing anything: the most common failure in this API is not a refusal, it is a success that did the wrong thing.
api-unitsCosts known before a call rather than read from a header afterwards. An erroneous call costs 20 units and a blind retry loop burns a daily allowance in minutes.
wordstat9 limits of the Wordstat API (Yandex Search API v2) with verbatim citations, 4 methods priced per 1000 calls, a retry table for 11 gRPC codes and 14 measured traps. The real bottleneck is the hourly quota, not the money: on quota exhaustion the service refuses rather than slows, so the budget is counted BEFORE the network, never retried through.

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/seer22/shturman-direct-mcp'

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