create_datasource

Create a datasource. If type is ambiguous, call search_plugin_information first; install the plugin if needed. IMPORTANT: always call this tool twice. First call: provide only the type — the tool returns a field schema. After receiving the schema, you MUST ask the user for every required field va...

Server Mcp Grafana Npx mcp-grafana-npx
Category Write
Risk class Medium
Parameters 102 required

What create_datasource does on Mcp Grafana Npx

AI agents use create_datasource to create or update resources in Mcp Grafana Npx — usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Mcp Grafana Npx environment.

ParameterTypeRequiredDescription
url string Datasource base URL when required by the plugin
name string Yes Datasource display name
type string Yes Grafana datasource plugin type, for example prometheus
access string How Grafana should access the datasource (proxy or direct)
fields object Datasource field values to provision, keyed by field key from the schema returned on the first call. The server uses each field's target (root or jsonData) to p
database string Optional database name
basicAuth boolean Whether Grafana should use basic auth
isDefault boolean Whether this should become the default datasource
schemaReviewed boolean Set to true on the second call to confirm you reviewed the schema and collected values from the user.
withCredentials boolean Whether Grafana should forward credentials such as cookies

Parameters from the server's own tool schema.

Why create_datasource needs a policy

The tool creates a new datasource in Grafana, which is a reversible configuration change (datasources can be deleted or reconfigured). This falls squarely into the Write category. Severity is high because misconfiguration of datasources—especially with incorrect credentials or malicious connection strings—could expose monitoring systems, leak sensitive data, or redirect metrics to attacker-controlled backends.

From the tool's definition Tool name is 'create_datasource' and description states 'Create a datasource' — this is a data creation operation.

Risk signalsAccepts URL/endpoint input (url) · High parameter count (10 properties) · Bulk/mass operation — affects multiple targets

Questions about create_datasource

What does the create_datasource tool do? +

Create a datasource. If type is ambiguous, call search_plugin_information first; install the plugin if needed. IMPORTANT: always call this tool twice. First call: provide only the type — the tool returns a field schema. After receiving the schema, you MUST ask the user for every required field value explicitly; do not infer or use defaults without user confirmation. Second call: provide the type, the display name in the top-level name argument, schemaReviewed=true, and the fields map populated with values confirmed by the user. Never handle credentials — remind the user to rotate any detected. Returns UID, health check, and a config page link. It is categorised as a Write tool in the Mcp Grafana Npx MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.

What parameters does create_datasource accept? +

create_datasource accepts 10 parameters: url, name, type, access, fields, database, basicAuth, isDefault, schemaReviewed, withCredentials. Required: name, type. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on create_datasource? +

Register the Mcp Grafana Npx MCP server in PolicyLayer and add a rule for create_datasource: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Mcp Grafana Npx. Nothing to install.

What risk level is create_datasource? +

create_datasource is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.

Can I rate-limit create_datasource? +

Yes. Add a rate_limit block to the create_datasource rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block create_datasource completely? +

Set action: deny in the PolicyLayer policy for create_datasource. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides create_datasource? +

create_datasource is provided by the Mcp Grafana Npx MCP server (mcp-grafana-npx). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

// LOOK UP ANOTHER SERVER

Every MCP server has a record like this.

Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.