Skip to main content
Glama
hostinger

hostinger-api-mcp

Official
by hostinger

Create a discount

ecommerce_createADiscountV1

Create a discount for a store with type, value, and optional conditions like start/end dates, usage limits, and minimum cart value.

Instructions

Create a discount for a store. Fixed discounts take an amount in the smallest currency unit (e.g. $10 is 1000); percentage discounts take a whole-number value between 1 and 100. Free-shipping discounts ignore value. Returns the created discount.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe discount code customers enter at checkout.
nameNoA human-friendly discount name.
typeYesThe discount type.
valueYesFor percentage discounts a whole number 1-100; for fixed discounts an amount in the smallest currency unit (e.g. $10 is 1000). Ignored for free_shipping.
ends_atNoWhen the discount expires. A bare date runs to the end of that day in time_zone. Never expires when omitted.
store_idYesThe ID of the store to create the discount for.
starts_atNoWhen the discount becomes active. A bare date (2026-11-27) anchors to time_zone. Defaults to now when omitted.
time_zoneNoIANA time zone used to interpret starts_at and ends_at.
allocationNoWhether the discount applies to the cart total or to each eligible item.
usage_limitNoMaximum number of times the discount can be redeemed.
min_cart_valueNoMinimum cart value in the smallest currency unit required for the discount to apply.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv1.45.5

TDQS

B3.4/5.0
Behavior3/5

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

Annotations show readOnlyHint=false and destructiveHint=false, so a write operation is expected. The description adds that it 'returns the created discount,' which is useful return-behavior context. However, it does not disclose side-effect-relevant details such as code uniqueness requirements, store existence prerequisites, or whether an existing discount with the same code is rejected. 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 three short sentences, front-loaded with the core purpose and followed by the most nuanced parameter behavior and then the return value. It contains no filler, though the middle sentence repeats information already present in the schema.

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?

With 11 parameters, no output schema, and minimal annotations, the description plus schema is mostly sufficient. It covers the trickiest value-format semantics and the return value. It omits practical context like code uniqueness, required store existence, or how optional time-related fields behave, leaving the agent to infer some operational constraints.

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%, so the input schema documents all 11 parameters. The description's explanation of fixed versus percentage versus free-shipping value semantics largely duplicates the schema's own value parameter description, adding no new parameter-level meaning.

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

Purpose4/5

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

The description states a specific action and resource: 'Create a discount for a store.' This clearly identifies what the tool does. It does not explicitly differentiate from sibling tools like ecommerce_listDiscountsV1, but the create/list distinction is obvious from the verb, and no competing create-discount sibling exists.

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

Usage Guidelines3/5

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

The intended use is implied by the action and store scope, but there is no explicit when-to-use or when-not-to-use guidance, nor any mention of alternatives. For an agent choosing among many ecommerce tools, the description could more directly state when this tool should be selected over list-only or other create tools.

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/hostinger/api-mcp-server'

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