Skip to main content
Glama

Create share

nextcloud_create_share

Create a share for one file or folder, including public links with URLs, user, group, or talk shares, permissions, passwords, and expiry dates.

Instructions

Share one file or folder and return the share (a public link carries its url).

POST /ocs/v2.php/apps/files_sharing/api/v1/shares

share_type user/group/talk needs share_with (user id, group id or conversation token). permissions is the OCS bitmask: 1 read, 2 update, 4 create, 8 delete, 16 share (31 all). expire_date is YYYY-MM-DD. send_mail false (the default) creates the share without the server mailing the recipient.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "nextcloud_create_share"
  }
}

Input Schema

NameRequiredDescriptionDefault
noteNo
pathYes
labelNo
passwordNo
send_mailNo
share_typeNopublic_link
share_withNo
expire_dateNo
permissionsNo
public_uploadNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv3.0.0
    • addedInput schema / properties / expire_date
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / label
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / note
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / password
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / public_upload
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
    • addedInput schema / properties / send_mail
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
    • changedInput schema / properties / share_type / default
      Previous value: -3New value: +"public_link"
    • addedInput schema / properties / share_type / enum
      Added value: +[
      +  "user",
      +  "group",
      +  "public_link",
      +  "email",
      +  "talk"
      +]
    • changedInput schema / properties / share_type / type
      Previous value: -"integer"New value: +"string"
    • addedInput schema / properties / share_with
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  2. First observedv2.3.4

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly=false, destructive=false, idempotent=false, openWorld=true, so the safety profile is covered. The description adds genuinely new behavioral context: the call returns the created share object, public links expose a url, and send_mail=false means the server will not mail the recipient. It stops short of stating required permissions or what happens on a duplicate share.

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 and return value are front-loaded in the first sentence, followed by the endpoint and then compact parameter notes. The raw POST path line adds little for an agent and the backtick-heavy formatting is dense, but there is no filler prose.

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?

For a 10-parameter, non-idempotent mutation tool with no output schema and zero schema descriptions, the definition should cover more. Explaining that password and public_upload apply only to public_link shares is missing, as is any note on failure modes such as sharing an already-shared path.

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

Parameters4/5

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

Schema coverage is 0%, so the description must carry the load, and it does for the highest-risk fields: the full OCS permission bitmask (1 read, 2 update, 4 create, 8 delete, 16 share, 31 all), the share_with dependency per share_type, and the YYYY-MM-DD expire_date format. It leaves password, label, note and public_upload completely unexplained, so compensation is partial rather than complete.

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?

States a specific verb and resource: "Share one file or folder and return the share", and even clarifies the public-link return shape (carries its ``url``). It is clearly distinct from nextcloud_update_share, nextcloud_get_share and nextcloud_delete_share by name, though it never explicitly names those siblings as alternatives.

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?

Gives conditional guidance for parameters (share_type user/group/talk requires share_with) and the default behavior of send_mail, which implies how to configure the call. It does not say when to use this rather than nextcloud_update_share or nextcloud_add_participant, nor any prerequisites such as needing ownership of the file.

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